aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2019-12-01 18:18:03 +0000
committergingerBill <bill@gingerbill.org>2019-12-01 18:18:03 +0000
commit46582a45bdd3fad0224b8d210f4fa5f2e7f84db8 (patch)
tree27086c06f74c17b04d5e4a5bbcdb6b252280c1ef
parent6b5ea011e76de3f82ca2b88e1b86161e98448ae8 (diff)
Fix IR string interning type
-rw-r--r--build.bat2
-rw-r--r--src/ir.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/build.bat b/build.bat
index 5615a557d..b95e8a2ab 100644
--- a/build.bat
+++ b/build.bat
@@ -41,7 +41,7 @@ del *.ilk > NUL 2> NUL
cl %compiler_settings% "src\main.cpp" ^
/link %linker_settings% -OUT:%exe_name% ^
- && odin build examples/demo/demo.odin -keep-temp-files
+ && odin run examples/demo/demo.odin
del *.obj > NUL 2> NUL
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;