authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-06-11 13:48:53-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-06-11 13:48:53-04:00
log515092210fe9d9f55c146bdea78289273b97bc0b
treec5f6c0248532ae21b7e6a516b4f585efaab93f8f
parent1c2e889820e50e26654990750ac5ef0755996618
signature Commit is signed but in an unrecognized format.

fix not checking return value of resolving result


2 files changed, 4 insertions(+), 0 deletions(-)

BRANCH_TODO+2
...@@ -1,6 +1,8 @@...@@ -1,6 +1,8 @@
1Scratch pad for stuff to do before merging master1Scratch pad for stuff to do before merging master
2=================================================2=================================================
33
4get an empty file compiling successfully (with no panic fn override)
5
4uncomment all the behavior tests6uncomment all the behavior tests
57
6look at all the ir_gen_node ir_gen_node_extra calls and make sure result locations are properly propagated8look at all the ir_gen_node ir_gen_node_extra calls and make sure result locations are properly propagated
src/ir.cpp+2
...@@ -14946,6 +14946,8 @@ static IrInstruction *ir_analyze_instruction_resolve_result(IrAnalyze *ira, IrIn...@@ -14946,6 +14946,8 @@ static IrInstruction *ir_analyze_instruction_resolve_result(IrAnalyze *ira, IrIn
14946 return ira->codegen->invalid_instruction;14946 return ira->codegen->invalid_instruction;
14947 IrInstruction *result_loc = ir_resolve_result(ira, &instruction->base, instruction->result_loc,14947 IrInstruction *result_loc = ir_resolve_result(ira, &instruction->base, instruction->result_loc,
14948 implicit_elem_type, nullptr);14948 implicit_elem_type, nullptr);
14949 if (instr_is_unreachable(result_loc) || type_is_invalid(result_loc->value.type))
14950 return result_loc;
14949 ir_assert(result_loc->value.type->id == ZigTypeIdPointer, &instruction->base);14951 ir_assert(result_loc->value.type->id == ZigTypeIdPointer, &instruction->base);
14950 ZigType *actual_elem_type = result_loc->value.type->data.pointer.child_type;14952 ZigType *actual_elem_type = result_loc->value.type->data.pointer.child_type;
14951 if (actual_elem_type->id == ZigTypeIdOptional && implicit_elem_type->id != ZigTypeIdOptional) {14953 if (actual_elem_type->id == ZigTypeIdOptional && implicit_elem_type->id != ZigTypeIdOptional) {