- Parse error in $defined was not handled correctly, leading to an assertion.

This commit is contained in:
Christoffer Lerno
2025-12-29 22:09:39 +01:00
parent c6a96ad7f3
commit 56f8008d85
3 changed files with 6 additions and 1 deletions

View File

@@ -37,6 +37,7 @@
- Compiler assert when passing returning CT failure immediately rethrown #2689.
- Converting between simd/non-simd bool vector would hit a compiler assert. #2691
- `i<n>` suffixes were not caught when n < 8, causing an assert.
- Parse error in `$defined` was not handled correctly, leading to an assertion.
### Stdlib changes
- Add `ThreadPool` join function to wait for all threads to finish in the pool without destroying the threads.

View File

@@ -1209,7 +1209,7 @@ static Expr *parse_ct_defined(ParseContext *c, Expr *left, SourceSpan lhs_start
vec_add(defined->expression_list, expr);
if (!try_consume(c, TOKEN_COMMA))
{
CONSUME_OR_RET(TOKEN_RPAREN, false);
CONSUME_OR_RET(TOKEN_RPAREN, poisoned_expr);
break;
}
}

View File

@@ -0,0 +1,4 @@
fn void main()
{
$defined(usz a*); // #error: Expected ')'
}