mirror of
https://github.com/ziglang/zig.git
synced 2026-11-22 04:37:39 -05:00
llvm backend: fix not updating map after deleting global
This was uncaught UB!
This commit is contained in:
1 parent
b34f994c0b
commit
65576ea2ea
1 file changed
+1
@@ -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();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user