mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 23:58:50 +00:00
Fix issue #137
This commit is contained in:
+3
-3
@@ -1750,7 +1750,7 @@ irValue *ir_gen_map_key(irProcedure *proc, irValue *key, Type *key_type) {
|
|||||||
if (is_type_integer(t)) {
|
if (is_type_integer(t)) {
|
||||||
ir_emit_store(proc, ir_emit_struct_ep(proc, v, 0), ir_emit_conv(proc, key, hash_type));
|
ir_emit_store(proc, ir_emit_struct_ep(proc, v, 0), ir_emit_conv(proc, key, hash_type));
|
||||||
} else if (is_type_pointer(t)) {
|
} 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));
|
ir_emit_store(proc, ir_emit_struct_ep(proc, v, 0), ir_emit_conv(proc, p, hash_type));
|
||||||
} else if (is_type_float(t)) {
|
} else if (is_type_float(t)) {
|
||||||
irValue *bits = nullptr;
|
irValue *bits = nullptr;
|
||||||
@@ -2980,8 +2980,8 @@ irValue *ir_emit_conv(irProcedure *proc, irValue *value, Type *t) {
|
|||||||
ev = exact_value_to_integer(ev);
|
ev = exact_value_to_integer(ev);
|
||||||
} else if (is_type_pointer(dst)) {
|
} else if (is_type_pointer(dst)) {
|
||||||
// IMPORTANT NOTE(bill): LLVM doesn't support pointer constants expect `null`
|
// IMPORTANT NOTE(bill): LLVM doesn't support pointer constants expect `null`
|
||||||
irValue *i = ir_add_module_constant(proc->module, t_uint, ev);
|
irValue *i = ir_add_module_constant(proc->module, t_uintptr, ev);
|
||||||
return ir_emit(proc, ir_instr_conv(proc, irConv_inttoptr, i, t_uint, dst));
|
return ir_emit(proc, ir_instr_conv(proc, irConv_inttoptr, i, t_uintptr, dst));
|
||||||
}
|
}
|
||||||
return ir_add_module_constant(proc->module, t, ev);
|
return ir_add_module_constant(proc->module, t, ev);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user