about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/common.rs
diff options
context:
space:
mode:
authorLaurențiu Nicola <lnicola@users.noreply.github.com>2025-02-17 12:30:13 +0000
committerGitHub <noreply@github.com>2025-02-17 12:30:13 +0000
commit0c9c489355a25ad6c89f6b009743a780b2ac97bd (patch)
tree7dc4e427cc53a909fe61c9f68086084073a58fff /compiler/rustc_codegen_llvm/src/common.rs
parent2a0d16f3c481cdf28366f88d3824f4a30ff806c9 (diff)
parent952bfae057206f01c3afd126752389eef353b56a (diff)
downloadrust-0c9c489355a25ad6c89f6b009743a780b2ac97bd.tar.gz
rust-0c9c489355a25ad6c89f6b009743a780b2ac97bd.zip
Merge pull request #19169 from lnicola/sync-from-rust
minor: Sync from downstream
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/common.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/common.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/common.rs b/compiler/rustc_codegen_llvm/src/common.rs
index 8c94a46ebf3..78b3a7f8541 100644
--- a/compiler/rustc_codegen_llvm/src/common.rs
+++ b/compiler/rustc_codegen_llvm/src/common.rs
@@ -219,8 +219,8 @@ impl<'ll, 'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
                 let g = self.define_global(&sym, self.val_ty(sc)).unwrap_or_else(|| {
                     bug!("symbol `{}` is already defined", sym);
                 });
+                llvm::set_initializer(g, sc);
                 unsafe {
-                    llvm::LLVMSetInitializer(g, sc);
                     llvm::LLVMSetGlobalConstant(g, True);
                     llvm::LLVMSetUnnamedAddress(g, llvm::UnnamedAddr::Global);
                 }