authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-12-22 17:09:11-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-12-22 17:09:11-05:00
logad92227516bf977a3be2802db525ac2d678acc7c
tree881ab1f3d00313266e6c78b9cc770b5950e19bf8
parent28dbdba37eed0cfd875cfc337446da3048743dd9
signaturelock-open Commit is signed but in an unrecognized format.

report compile errors instead of crashing when frame is invalid


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

src/analyze.cpp+2
......@@ -2003,6 +2003,8 @@ bool type_is_invalid(ZigType *type_entry) {
20032003 return type_entry->data.unionation.resolve_status == ResolveStatusInvalid;
20042004 case ZigTypeIdEnum:
20052005 return type_entry->data.enumeration.resolve_status == ResolveStatusInvalid;
2006 case ZigTypeIdFnFrame:
2007 return type_entry->data.frame.reported_loop_err;
20062008 default:
20072009 return false;
20082010 }
src/ir.cpp+2
......@@ -17061,6 +17061,8 @@ static Error ir_result_has_type(IrAnalyze *ira, ResultLoc *result_loc, bool *out
1706117061static IrInstruction *ir_resolve_no_result_loc(IrAnalyze *ira, IrInstruction *suspend_source_instr,
1706217062 ResultLoc *result_loc, ZigType *value_type, bool force_runtime, bool non_null_comptime)
1706317063{
17064 if (type_is_invalid(value_type))
17065 return ira->codegen->invalid_instruction;
1706417066 IrInstructionAllocaGen *alloca_gen = ir_build_alloca_gen(ira, suspend_source_instr, 0, "");
1706517067 alloca_gen->base.value->type = get_pointer_to_type_extra(ira->codegen, value_type, false, false,
1706617068 PtrLenSingle, 0, 0, 0, false);