diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-04-11 22:43:33 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-04-11 22:43:33 +0100 |
| commit | 8e73d1ce1f840c71ff5df03a360b5870140be86e (patch) | |
| tree | 5ac32504ef6b8a434c0db72e884bf3574f2b9aa1 /src | |
| parent | b53d16d1d568fc0a3c87d1168b4cd8e2572cc41c (diff) | |
Fix map bug which removed N values from the beginning
Diffstat (limited to 'src')
| -rw-r--r-- | src/ir.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1502,12 +1502,15 @@ irValue *ir_gen_map_header(irProcedure *proc, irValue *map_val, Type *map_type) ir_emit_store(proc, ir_emit_struct_ep(proc, h, 1), v_true); } - i64 entry_size = type_size_of(a, map_type->Map.entry_type); - i64 entry_align = type_align_of(a, map_type->Map.entry_type); + i64 entry_size = type_size_of(a, map_type->Map.entry_type); + i64 entry_align = type_align_of(a, map_type->Map.entry_type); i64 value_offset = type_offset_of(a, map_type->Map.entry_type, 2); + i64 value_size = type_size_of(a, map_type->Map.value); + 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, 5), ir_const_int(a, value_size)); return ir_emit_load(proc, h); |