about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src
diff options
context:
space:
mode:
authorFolkert de Vries <folkert@folkertdev.nl>2025-07-27 23:07:03 +0200
committerFolkert de Vries <folkert@folkertdev.nl>2025-08-31 16:07:28 +0200
commit213bb873518b5e6f7612cd3ac373603170b76e2b (patch)
tree2dd8fbc5eb90967ba982ab77a1a36f2b3dc645c4 /compiler/rustc_codegen_ssa/src
parent002751155d135de7ef6cfd88404f2bd2b7983b51 (diff)
downloadrust-213bb873518b5e6f7612cd3ac373603170b76e2b.tar.gz
rust-213bb873518b5e6f7612cd3ac373603170b76e2b.zip
explicitly end `va_list` lifetime
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
-rw-r--r--compiler/rustc_codegen_ssa/src/mir/block.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/block.rs b/compiler/rustc_codegen_ssa/src/mir/block.rs
index c3dc3e42b83..5f6976f5d00 100644
--- a/compiler/rustc_codegen_ssa/src/mir/block.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/block.rs
@@ -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"),
             }