aboutsummaryrefslogtreecommitdiff
path: root/src/ir.c
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-06-05 23:06:15 +0100
committerGinger Bill <bill@gingerbill.org>2017-06-05 23:06:15 +0100
commitd2e7d730ac88bf0ce4f9c823085d7880c30db01e (patch)
treea60d484850e5b83a32a94a76ab77c095bc22f6e1 /src/ir.c
parent817e4b663e111f768a8fe9af4d3bc53f56de08b6 (diff)
Fix key generation for constant strings in IR
Diffstat (limited to 'src/ir.c')
-rw-r--r--src/ir.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ir.c b/src/ir.c
index f5f48ec9c..e4b086eb1 100644
--- a/src/ir.c
+++ b/src/ir.c
@@ -1682,8 +1682,8 @@ irValue *ir_gen_map_key(irProcedure *proc, irValue *key, Type *key_type) {
if (str->kind == irValue_Constant) {
ExactValue ev = str->Constant.value;
GB_ASSERT(ev.kind == ExactValue_String);
- u64 hs = gb_fnv64a(ev.value_string.text, ev.value_string.len);
- hashed_str = ir_const_u64(proc->module->allocator, hs);
+ u128 hs = fnv128a(ev.value_string.text, ev.value_string.len);
+ hashed_str = ir_value_constant(proc->module->allocator, t_u128, exact_value_u128(hs));
} else {
irValue **args = gb_alloc_array(proc->module->allocator, irValue *, 1);
args[0] = str;
@@ -1729,7 +1729,7 @@ Type *ir_addr_type(irAddr addr) {
}
irValue *ir_insert_dynamic_map_key_and_value(irProcedure *proc, irValue *addr, Type *map_type,
- irValue *map_key, irValue *map_value) {
+ irValue *map_key, irValue *map_value) {
map_type = base_type(map_type);
irValue *h = ir_gen_map_header(proc, addr, map_type);