aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/llvm.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-01-24 11:39:32 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-01-24 21:47:53 -0700
commit65576ea2ea8f0d1bcbd1b60dce115c25fc4647ad (patch)
treec64fc2a038165bfad060afc4bd61851f67115444 /src/codegen/llvm.zig
parentb34f994c0ba2d87fce2a3409d6bcfa7a5ebe78ff (diff)
downloadzig-65576ea2ea8f0d1bcbd1b60dce115c25fc4647ad.tar.gz
zig-65576ea2ea8f0d1bcbd1b60dce115c25fc4647ad.zip
llvm backend: fix not updating map after deleting global
This was uncaught UB!
Diffstat (limited to 'src/codegen/llvm.zig')
-rw-r--r--src/codegen/llvm.zig1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig
index 763f72dc10..9a4ae2f950 100644
--- a/src/codegen/llvm.zig
+++ b/src/codegen/llvm.zig
@@ -662,6 +662,7 @@ pub const DeclGen = struct {
new_global.setAlignment(global.getAlignment());
new_global.setInitializer(llvm_init);
global.replaceAllUsesWith(new_global);
+ dg.object.decl_map.putAssumeCapacity(decl, new_global);
new_global.takeName(global);
global.deleteGlobal();
}