| ... | @@ -3702,6 +3702,15 @@ static TypeTableEntry *analyze_cast_expr(CodeGen *g, ImportTableEntry *import, B | ... | @@ -3702,6 +3702,15 @@ static TypeTableEntry *analyze_cast_expr(CodeGen *g, ImportTableEntry *import, B |
| 3702 | return resolve_cast(g, context, node, expr_node, wanted_type, CastOpPointerReinterpret, false); | 3702 | return resolve_cast(g, context, node, expr_node, wanted_type, CastOpPointerReinterpret, false); |
| 3703 | } | 3703 | } |
| 3704 | | 3704 | |
| | 3705 | // explicit cast from maybe pointer to another maybe pointer |
| | 3706 | if (actual_type->id == TypeTableEntryIdMaybe && |
| | 3707 | actual_type->data.maybe.child_type->id == TypeTableEntryIdPointer && |
| | 3708 | wanted_type->id == TypeTableEntryIdMaybe && |
| | 3709 | wanted_type->data.maybe.child_type->id == TypeTableEntryIdPointer) |
| | 3710 | { |
| | 3711 | return resolve_cast(g, context, node, expr_node, wanted_type, CastOpPointerReinterpret, false); |
| | 3712 | } |
| | 3713 | |
| 3705 | // explicit cast from child type of maybe type to maybe type | 3714 | // explicit cast from child type of maybe type to maybe type |
| 3706 | if (wanted_type->id == TypeTableEntryIdMaybe) { | 3715 | if (wanted_type->id == TypeTableEntryIdMaybe) { |
| 3707 | if (types_match_const_cast_only(wanted_type->data.maybe.child_type, actual_type)) { | 3716 | if (types_match_const_cast_only(wanted_type->data.maybe.child_type, actual_type)) { |