diff options
| author | gingerBill <bill@gingerbill.org> | 2017-11-08 22:02:15 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2017-11-08 22:02:15 +0000 |
| commit | 4777bd607ee74687b5adc471fa957f37dda7775a (patch) | |
| tree | 429f72c46b1e17cbdc72f2a2c0a9e7a5b3070730 /src/ir.cpp | |
| parent | 39e9b504828f5c15e93f97790f8f897686c3df3d (diff) | |
Fix issue #137
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 781021d4a..51052e206 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -1750,7 +1750,7 @@ irValue *ir_gen_map_key(irProcedure *proc, irValue *key, Type *key_type) { if (is_type_integer(t)) { ir_emit_store(proc, ir_emit_struct_ep(proc, v, 0), ir_emit_conv(proc, key, hash_type)); } else if (is_type_pointer(t)) { - irValue *p = ir_emit_conv(proc, key, t_uint); + irValue *p = ir_emit_conv(proc, key, t_uintptr); ir_emit_store(proc, ir_emit_struct_ep(proc, v, 0), ir_emit_conv(proc, p, hash_type)); } else if (is_type_float(t)) { irValue *bits = nullptr; @@ -2980,8 +2980,8 @@ irValue *ir_emit_conv(irProcedure *proc, irValue *value, Type *t) { ev = exact_value_to_integer(ev); } else if (is_type_pointer(dst)) { // IMPORTANT NOTE(bill): LLVM doesn't support pointer constants expect `null` - irValue *i = ir_add_module_constant(proc->module, t_uint, ev); - return ir_emit(proc, ir_instr_conv(proc, irConv_inttoptr, i, t_uint, dst)); + irValue *i = ir_add_module_constant(proc->module, t_uintptr, ev); + return ir_emit(proc, ir_instr_conv(proc, irConv_inttoptr, i, t_uintptr, dst)); } return ir_add_module_constant(proc->module, t, ev); } |