From 46582a45bdd3fad0224b8d210f4fa5f2e7f84db8 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sun, 1 Dec 2019 18:18:03 +0000 Subject: Fix IR string interning type --- src/ir.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index debd982c8..0051404e9 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -1614,7 +1614,7 @@ irValue *ir_add_global_string_array(irModule *m, String string) { if (global_constant_value == nullptr) { global_constant_value = ir_find_or_add_entity_string_byte_slice(m, string); } - Type *type = ir_type(global_constant_value); + Type *type = alloc_type_array(t_u8, string.len+1); isize max_len = 6+8+1; @@ -5069,7 +5069,7 @@ irValue *ir_find_or_add_entity_string_byte_slice(irModule *m, String str) { if (found != nullptr) { return *found; } - Type *t = alloc_type_array(t_u8, str.len+1); + Type *t = t_u8_slice; irValue *v = ir_value_constant(t, exact_value_string(str)); map_set(&m->const_string_byte_slices, key, v); return v; -- cgit v1.2.3