mirror of
https://github.com/ziglang/zig.git
synced 2026-02-01 20:23:38 +00:00
llvm backend: fix not updating map after deleting global
This was uncaught UB!
This commit is contained in:
parent
b34f994c0b
commit
65576ea2ea
@ -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();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user