From 3ba3421f5ff5b1a1e13347049f3789a119dd7fbf Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 29 Dec 2018 19:57:25 +0000 Subject: Fix `static` procedure name mangling --- src/ir.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index c94b2ec59..e8039b8fe 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -7960,7 +7960,6 @@ void ir_build_stmt_internal(irProcedure *proc, Ast *node) { Entity *e = entity_of_ident(ident); GB_ASSERT(e->flags & EntityFlag_Static); String name = e->token.string; - HashKey key = hash_string(name); String mangled_name = {}; { @@ -7971,6 +7970,9 @@ void ir_build_stmt_internal(irProcedure *proc, Ast *node) { mangled_name.len = gb_string_length(str); } + HashKey key = hash_string(mangled_name); + ir_add_entity_name(m, e, mangled_name); + irValue *g = ir_value_global(e, value); g->Global.name = mangled_name; g->Global.is_internal = true; -- cgit v1.2.3