about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-06-17 06:34:12 +0000
committerbors <bors@rust-lang.org>2021-06-17 06:34:12 +0000
commitcb3c4ee7187b045683cb9b86135dbbb766471091 (patch)
tree0228ef60b25278fbda7c1159daec94fc96fb963a /compiler/rustc_codegen_llvm/src
parent50a407200b970d8a48e4e58de37c94df355f5472 (diff)
parent7dccce07066ea58d7f8d1dd8462347e91e51c67a (diff)
downloadrust-cb3c4ee7187b045683cb9b86135dbbb766471091.tar.gz
rust-cb3c4ee7187b045683cb9b86135dbbb766471091.zip
Auto merge of #86164 - FabianWolff:issue-86053, r=davidtwco
Handle C-variadic arguments properly when reporting region errors

This pull request fixes #86053. The issue is that for a C-variadic function
```rust
#![feature(c_variadic)]
unsafe extern "C" fn foo(_: (), ...) {}
```
`foo`'s signature will contain only the first parameter (and have `c_variadic` set to `true`), whereas its body has a second argument (a `hir::Pat` for the `...`).

The code for reporting region errors iterates over the body's parameters and tries to fetch the corresponding parameter from the signature; this causes an out-of-bounds ICE for the `...` (though not in the example above, because there are no region errors to report).

I have simply restricted the iteration over the body parameters to exclude `...`, which is fine because `...` cannot cause a region error.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions