diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-06-05 23:06:15 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-06-05 23:06:15 +0100 |
| commit | d2e7d730ac88bf0ce4f9c823085d7880c30db01e (patch) | |
| tree | a60d484850e5b83a32a94a76ab77c095bc22f6e1 /src/ir.c | |
| parent | 817e4b663e111f768a8fe9af4d3bc53f56de08b6 (diff) | |
Fix key generation for constant strings in IR
Diffstat (limited to 'src/ir.c')
| -rw-r--r-- | src/ir.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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); |