Asserts are retained regardless of optimization when running tests.

This commit is contained in:
Christoffer Lerno
2024-09-07 15:40:32 +02:00
parent 1cc1b83b6f
commit 4f54e273ab
2 changed files with 2 additions and 1 deletions

View File

@@ -15,6 +15,7 @@
- Crash when reading an empty 'manifest.json'.
- "optsize" did not work correctly in project.json.
- `l[0].a = 1` now supported for overloads due to better lvalue handling #1357.
- Asserts are retained regardless of optimization when running tests.
### Stdlib changes
- Additional init functions for hashmap.

View File

@@ -1176,7 +1176,7 @@ static inline void llvm_emit_assert_stmt(GenContext *c, Ast *ast)
{
ExprId exprid = ast->assert_stmt.expr;
Expr *assert_expr = exprptr(exprid);
if (safe_mode_enabled())
if (safe_mode_enabled() || compiler.build.testing)
{
BEValue value;
llvm_emit_expr(c, &value, assert_expr);