Fix map IR bug

This commit is contained in:
gingerBill
2017-11-28 23:46:01 +00:00
parent cc28cda053
commit 04cce1826b
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -835,7 +835,7 @@ fmt_value :: proc(fi: ^Fmt_Info, v: any, verb: rune) {
write_string(fi.buf, "map[");
defer write_byte(fi.buf, ']');
entries := &((cast(^raw.Map)v.data).entries);
entries := &(^raw.Map)(v.data).entries;
gs := type_info_base(info.generated_struct).variant.(Type_Info_Struct);
ed := type_info_base(gs.types[1]).variant.(Type_Info_Dynamic_Array);
entry_type := ed.elem.variant.(Type_Info_Struct);
+1 -1
View File
@@ -7006,7 +7006,7 @@ void ir_build_stmt_internal(irProcedure *proc, AstNode *node) {
}
irValue *entries_ptr = ir_emit_struct_ep(proc, map, 1);
irValue *count_ptr = ir_emit_struct_ep(proc, entries_ptr, 1);
ir_build_range_indexed(proc, map, val0_type, count_ptr, &val, &key, &loop, &done);
ir_build_range_indexed(proc, map, val1_type, count_ptr, &val, &key, &loop, &done);
break;
}
case Type_Array: {