diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-08-25 21:45:11 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-08-25 21:45:11 -0400 |
| commit | b13af0750fbe8b38a95b05ec78c8364281fcf477 (patch) | |
| tree | 9520bbe9daa00221d11becc0f3e6848bd91a71b5 /src/ir.cpp | |
| parent | 720302a6407e954ffccf65f38ad40b47868627ce (diff) | |
| download | zig-b13af0750fbe8b38a95b05ec78c8364281fcf477.tar.gz zig-b13af0750fbe8b38a95b05ec78c8364281fcf477.zip | |
fix assertion tripped instead of reporting compile error
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index d9f7e37e8e..34c6985c6a 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -9006,7 +9006,8 @@ static bool ir_num_lit_fits_in_other_type(IrAnalyze *ira, IrInstruction *instruc } ConstExprValue *const_val = ir_resolve_const(ira, instruction, UndefBad); - assert(const_val != nullptr); + if (const_val == nullptr) + return false; bool const_val_is_int = (const_val->type->id == ZigTypeIdInt || const_val->type->id == ZigTypeIdComptimeInt); bool const_val_is_float = (const_val->type->id == ZigTypeIdFloat || const_val->type->id == ZigTypeIdComptimeFloat); |
