diff options
| author | gingerBill <bill@gingerbill.org> | 2019-11-09 10:44:42 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-11-09 10:44:42 +0000 |
| commit | 7bfdb4f9f46dcccd0ea0bf2581f243d69d5d426f (patch) | |
| tree | 4a8785fe515bccc5dee6c3955fe0e46b469a8de7 /src/check_expr.cpp | |
| parent | 0a35b13411faca7d7059501a45c0649b6edf374a (diff) | |
Fix Compile time assert on non-constant boolean parameters #467
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 995582f64..ad6ad2706 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -3523,12 +3523,13 @@ bool check_builtin_procedure(CheckerContext *c, Operand *operand, Ast *call, i32 error(call, "'#assert' expects 1 argument, got %td", ce->args.count); return false; } - if (!is_type_boolean(operand->type) && operand->mode != Addressing_Constant) { + if (!is_type_boolean(operand->type) || operand->mode != Addressing_Constant) { gbString str = expr_to_string(ce->args[0]); error(call, "'%s' is not a constant boolean", str); gb_string_free(str); return false; } + gb_printf_err("%s %d\n", expr_to_string(operand->expr), operand->mode); if (!operand->value.value_bool) { gbString arg = expr_to_string(ce->args[0]); error(call, "Compile time assertion: %s", arg); |