aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-12-22 17:09:11 -0500
committerAndrew Kelley <andrew@ziglang.org>2019-12-22 17:09:11 -0500
commitad92227516bf977a3be2802db525ac2d678acc7c (patch)
tree881ab1f3d00313266e6c78b9cc770b5950e19bf8 /src/ir.cpp
parent28dbdba37eed0cfd875cfc337446da3048743dd9 (diff)
downloadzig-ad92227516bf977a3be2802db525ac2d678acc7c.tar.gz
zig-ad92227516bf977a3be2802db525ac2d678acc7c.zip
report compile errors instead of crashing when frame is invalid
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index d60fe9ea70..a862ff1068 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -17061,6 +17061,8 @@ static Error ir_result_has_type(IrAnalyze *ira, ResultLoc *result_loc, bool *out
static IrInstruction *ir_resolve_no_result_loc(IrAnalyze *ira, IrInstruction *suspend_source_instr,
ResultLoc *result_loc, ZigType *value_type, bool force_runtime, bool non_null_comptime)
{
+ if (type_is_invalid(value_type))
+ return ira->codegen->invalid_instruction;
IrInstructionAllocaGen *alloca_gen = ir_build_alloca_gen(ira, suspend_source_instr, 0, "");
alloca_gen->base.value->type = get_pointer_to_type_extra(ira->codegen, value_type, false, false,
PtrLenSingle, 0, 0, 0, false);