mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Crash when a constant null typeid is checked for properties. #1679
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
- Incorrect "no-libc" definition of `cos`, making it unavailable for wasm.
|
||||
- Fix issue with the adjoint and inverse calculations for `Matrix2x2`.
|
||||
- It was possible to create 0 length arrays using byte literals. #1678
|
||||
- Crash when a constant null typeid is checked for properties. #1679
|
||||
|
||||
### Stdlib changes
|
||||
- Add `io::MultiReader`, `io::MultiWriter`, and `io::TeeReader` structs.
|
||||
|
||||
@@ -4289,6 +4289,7 @@ static bool sema_expr_rewrite_to_typeid_property(SemaContext *context, Expr *exp
|
||||
if (sema_cast_const(typeid))
|
||||
{
|
||||
Type *type = typeid->const_expr.typeid;
|
||||
if (type == NULL) return false;
|
||||
if (!sema_type_property_is_valid_for_type(type, property)) return false;
|
||||
*was_error = !sema_expr_rewrite_to_type_property(context, expr, type, property, type);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user