zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 65576ea2ea8f0d1bcbd1b60dce115c25fc4647ad (tree)
parent b34f994c0ba2d87fce2a3409d6bcfa7a5ebe78ff
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Mon, 24 Jan 2022 11:39:32 -0700

llvm backend: fix not updating map after deleting global

This was uncaught UB!

Diffstat:
Msrc/codegen/llvm.zig | 1+
1 file changed, 1 insertion(+), 0 deletions(-)

diff --git 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(); }