diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-09-07 15:17:24 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-09-07 15:17:24 -0400 |
| commit | b18af37c578b118a245c911508d73ed23c303ee0 (patch) | |
| tree | 5d05f47eff497583cdf97c0943787d576b6ca60e /src/ir.cpp | |
| parent | 7505529e448dc9e07e9220addc994dc5b4a524fd (diff) | |
| download | zig-b18af37c578b118a245c911508d73ed23c303ee0.tar.gz zig-b18af37c578b118a245c911508d73ed23c303ee0.zip | |
fix crash when var init has compile error
and then the var is referenced
closes #1483
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 0269c29b1a..30f40b3a1e 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -13107,8 +13107,7 @@ static IrInstruction *ir_get_var_ptr(IrAnalyze *ira, IrInstruction *instruction, assert(ira->codegen->errors.length != 0); return ira->codegen->invalid_instruction; } - assert(var->value->type); - if (type_is_invalid(var->value->type)) + if (var->value->type == nullptr || type_is_invalid(var->value->type)) return ira->codegen->invalid_instruction; bool comptime_var_mem = ir_get_var_is_comptime(var); |
