- Crash when trying to create a const zero untyped list #2847

This commit is contained in:
Christoffer Lerno
2026-01-27 23:36:00 +01:00
parent c11385cf49
commit c1e3cfaacc
3 changed files with 10 additions and 1 deletions

View File

@@ -139,6 +139,7 @@
- Packed structs sometimes not lowered as such.
- Crash when creating `$Type*` where `$Type` is an optional type #2848
- Crashes when using `io::EOF~!` in various unhandled places. #2848
- Crash when trying to create a const zero untyped list #2847
### Stdlib changes
- Add `ThreadPool` join function to wait for all threads to finish in the pool without destroying the threads.

View File

@@ -702,10 +702,14 @@ void expr_rewrite_to_const_zero(Expr *expr, Type *type)
case TYPE_OPTIONAL:
case TYPE_TYPEINFO:
case TYPE_MEMBER:
case TYPE_UNTYPED_LIST:
case TYPE_INFERRED_ARRAY:
case TYPE_FLEXIBLE_ARRAY:
UNREACHABLE_VOID
case TYPE_UNTYPED_LIST:
expr->const_expr.const_kind = CONST_UNTYPED_LIST;
expr->const_expr.untyped_list = NULL;
expr->resolve_status = RESOLVE_DONE;
break;
case TYPE_SLICE:
expr_rewrite_const_empty_slice(expr, type);
return;

View File

@@ -0,0 +1,4 @@
fn void main()
{
$typeof({1}) $untyped_list;
}