mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- Crash when trying to create a const zero untyped list #2847
This commit is contained in:
@@ -139,6 +139,7 @@
|
|||||||
- Packed structs sometimes not lowered as such.
|
- Packed structs sometimes not lowered as such.
|
||||||
- Crash when creating `$Type*` where `$Type` is an optional type #2848
|
- Crash when creating `$Type*` where `$Type` is an optional type #2848
|
||||||
- Crashes when using `io::EOF~!` in various unhandled places. #2848
|
- Crashes when using `io::EOF~!` in various unhandled places. #2848
|
||||||
|
- Crash when trying to create a const zero untyped list #2847
|
||||||
|
|
||||||
### Stdlib changes
|
### Stdlib changes
|
||||||
- Add `ThreadPool` join function to wait for all threads to finish in the pool without destroying the threads.
|
- Add `ThreadPool` join function to wait for all threads to finish in the pool without destroying the threads.
|
||||||
|
|||||||
@@ -702,10 +702,14 @@ void expr_rewrite_to_const_zero(Expr *expr, Type *type)
|
|||||||
case TYPE_OPTIONAL:
|
case TYPE_OPTIONAL:
|
||||||
case TYPE_TYPEINFO:
|
case TYPE_TYPEINFO:
|
||||||
case TYPE_MEMBER:
|
case TYPE_MEMBER:
|
||||||
case TYPE_UNTYPED_LIST:
|
|
||||||
case TYPE_INFERRED_ARRAY:
|
case TYPE_INFERRED_ARRAY:
|
||||||
case TYPE_FLEXIBLE_ARRAY:
|
case TYPE_FLEXIBLE_ARRAY:
|
||||||
UNREACHABLE_VOID
|
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:
|
case TYPE_SLICE:
|
||||||
expr_rewrite_const_empty_slice(expr, type);
|
expr_rewrite_const_empty_slice(expr, type);
|
||||||
return;
|
return;
|
||||||
|
|||||||
4
test/test_suite/macros/typeof_untyped_list_zero.c3t
Normal file
4
test/test_suite/macros/typeof_untyped_list_zero.c3t
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
fn void main()
|
||||||
|
{
|
||||||
|
$typeof({1}) $untyped_list;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user