explicitly end va_list lifetime
This commit is contained in:
parent
002751155d
commit
213bb87351
1 changed files with 3 additions and 0 deletions
|
|
@ -519,6 +519,9 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
|||
match self.locals[mir::Local::from_usize(1 + va_list_arg_idx)] {
|
||||
LocalRef::Place(va_list) => {
|
||||
bx.va_end(va_list.val.llval);
|
||||
|
||||
// Explicitly end the lifetime of the `va_list`, this matters for LLVM.
|
||||
bx.lifetime_end(va_list.val.llval, va_list.layout.size);
|
||||
}
|
||||
_ => bug!("C-variadic function must have a `VaList` place"),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue