diff options
| author | gingerBill <bill@gingerbill.org> | 2019-10-05 09:40:05 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-10-05 09:40:05 +0100 |
| commit | dae514a2c99875db0dbda56309c7349a68432e19 (patch) | |
| tree | 0befb553b7f1f0b623db9dd7b997390506d72ad9 /src/check_expr.cpp | |
| parent | 068993a819b17dca442f286a0b9b7817bf8d7120 (diff) | |
Fix Using any in if statement asserts compiler #441
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 5535e6772..697abef5f 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -1580,8 +1580,10 @@ void check_cast_error_suggestion(CheckerContext *c, Operand *o, Type *type) { void check_is_expressible(CheckerContext *c, Operand *o, Type *type) { - GB_ASSERT(is_type_constant_type(type)); GB_ASSERT(o->mode == Addressing_Constant); + if (!is_type_constant_type(type)) { + return; + } if (!check_representable_as_constant(c, o->value, type, &o->value)) { gbString a = expr_to_string(o->expr); gbString b = type_to_string(type); |