From 4777bd607ee74687b5adc471fa957f37dda7775a Mon Sep 17 00:00:00 2001 From: gingerBill Date: Wed, 8 Nov 2017 22:02:15 +0000 Subject: Fix issue #137 --- src/ir.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ir.cpp') 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); } -- cgit v1.2.3