mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 14:48:47 +00:00
Fix IR string interning type
This commit is contained in:
@@ -41,7 +41,7 @@ del *.ilk > NUL 2> NUL
|
|||||||
|
|
||||||
cl %compiler_settings% "src\main.cpp" ^
|
cl %compiler_settings% "src\main.cpp" ^
|
||||||
/link %linker_settings% -OUT:%exe_name% ^
|
/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
|
del *.obj > NUL 2> NUL
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1614,7 +1614,7 @@ irValue *ir_add_global_string_array(irModule *m, String string) {
|
|||||||
if (global_constant_value == nullptr) {
|
if (global_constant_value == nullptr) {
|
||||||
global_constant_value = ir_find_or_add_entity_string_byte_slice(m, string);
|
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;
|
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) {
|
if (found != nullptr) {
|
||||||
return *found;
|
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));
|
irValue *v = ir_value_constant(t, exact_value_string(str));
|
||||||
map_set(&m->const_string_byte_slices, key, v);
|
map_set(&m->const_string_byte_slices, key, v);
|
||||||
return v;
|
return v;
|
||||||
|
|||||||
Reference in New Issue
Block a user