aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2017-11-09 22:58:44 +0000
committergingerBill <bill@gingerbill.org>2017-11-09 22:58:44 +0000
commite5c39fb2a98d878b0cf5ca6fcea3a776527628a1 (patch)
tree9917f1557b9671e03726499ba550b3358d04b839 /src/ir.cpp
parenteb4b3f5976d1563cd97841964e829fc638179cc5 (diff)
Fix opening file without close; Minor fixes
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 88c20d312..5eb380f9f 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -1129,6 +1129,9 @@ irValue *ir_emit(irProcedure *proc, irValue *instr) {
irValue *ir_const_int(gbAllocator a, i64 i) {
return ir_value_constant(a, t_int, exact_value_i64(i));
}
+irValue *ir_const_uintptr(gbAllocator a, u64 i) {
+ return ir_value_constant(a, t_uintptr, exact_value_i64(i));
+}
irValue *ir_const_i32(gbAllocator a, i32 i) {
return ir_value_constant(a, t_i32, exact_value_i64(i));
}
@@ -1735,7 +1738,7 @@ irValue *ir_gen_map_header(irProcedure *proc, irValue *map_val, Type *map_type)
ir_emit_store(proc, ir_emit_struct_ep(proc, h, 2), ir_const_int(a, entry_size));
ir_emit_store(proc, ir_emit_struct_ep(proc, h, 3), ir_const_int(a, entry_align));
- ir_emit_store(proc, ir_emit_struct_ep(proc, h, 4), ir_const_int(a, value_offset));
+ ir_emit_store(proc, ir_emit_struct_ep(proc, h, 4), ir_const_uintptr(a, value_offset));
ir_emit_store(proc, ir_emit_struct_ep(proc, h, 5), ir_const_int(a, value_size));