- $defined(hashmap.init(mem)) causes compiler segfault #2611.

This commit is contained in:
Christoffer Lerno
2025-11-30 00:08:46 +01:00
parent a26055c932
commit 9d79c3f33d
3 changed files with 9 additions and 2 deletions

View File

@@ -47,6 +47,7 @@
- Unexpected maybe-deref subscript error with out parameter #2600.
- Bug on rethrow in return with defer #2603.
- Fix bug when converting from vector to distinct type of wider vector. #2604
- `$defined(hashmap.init(mem))` causes compiler segfault #2611.
### Stdlib changes
- Add `CGFloat` `CGPoint` `CGSize` `CGRect` types to core_foundation (macOS).

View File

@@ -3728,7 +3728,6 @@ static inline bool sema_call_analyse_member_get(SemaContext *context, Expr *expr
}
static inline bool sema_expr_analyse_call(SemaContext *context, Expr *expr, bool *no_match_ref)
{
if (no_match_ref) *no_match_ref = true;
Expr *func_expr = exprptr(expr->call_expr.function);
if (!sema_analyse_expr(context, func_expr)) return false;
bool optional = func_expr->type && IS_OPTIONAL(func_expr);
@@ -11042,7 +11041,7 @@ static inline bool sema_expr_analyse_ct_defined(SemaContext *context, Expr *expr
}
case EXPR_CALL:
{
bool no_match;
bool no_match = false;
if (!sema_expr_analyse_call(active_context, main_expr, &no_match))
{
if (!no_match) goto FAIL;

View File

@@ -0,0 +1,7 @@
module defined_call;
import std;
HashMap {String, int} val;
const bool V = $defined(val.init(mem));
fn void main() {}