Compiler hangs on == overload if other is generic #2443

Fix missing end of line when encountering errors in project creation.
This commit is contained in:
Christoffer Lerno
2025-08-31 23:40:55 +02:00
parent cb006dd715
commit d291a40f69
4 changed files with 8 additions and 5 deletions

View File

@@ -90,6 +90,8 @@
- Fix regression where files were added more than once. #2442
- Disambiguate types when they have the same name and need cast between each other.
- Compiler module-scope pointer to slice with offset, causes assert. #2446
- Compiler hangs on == overload if other is generic #2443
- Fix missing end of line when encountering errors in project creation.
### Stdlib changes
- Add `==` to `Pair`, `Triple` and TzDateTime. Add print to `Pair` and `Triple`.

View File

@@ -439,7 +439,7 @@ static void exit_fail(const char *fmt, ...)
va_start(list, fmt);
vfprintf(stderr, fmt, list);
va_end(list);
fputs("", stderr);
fputs("\n", stderr);
exit_compiler(EXIT_FAILURE);
}
@@ -453,7 +453,7 @@ static void exit_fail(const char *fmt, ...)
}
vfprintf(stderr, fmt, list);
va_end(list);
fputs("", stderr);
fputs("\n", stderr);
exit_compiler(EXIT_FAILURE);
}

View File

@@ -724,7 +724,7 @@ static inline void llvm_emit_subscript_addr(GenContext *c, BEValue *value, Expr
needs_len = (safe_mode_enabled() && !llvm_is_global_eval(c)) || start_from_end;
if (needs_len)
{
if (LLVMIsAGlobalVariable(value->value))
if (LLVMIsAGlobalVariable(value->value) && llvm_is_global_eval(c))
{
llvm_value_set(&len, LLVMGetInitializer(value->value), parent_type);
llvm_emit_slice_len(c, &len, &len);
@@ -5088,7 +5088,7 @@ void llvm_emit_slice_pointer(GenContext *c, BEValue *slice, BEValue *pointer)
llvm_value_fold_optional(c, slice);
if (slice->kind == BE_ADDRESS)
{
if (LLVMIsAGlobalVariable(slice->value))
if (LLVMIsAGlobalVariable(slice->value) && llvm_is_global_eval(c))
{
llvm_value_set(slice, LLVMGetInitializer(slice->value), slice->type);
goto NEXT;

View File

@@ -8235,7 +8235,8 @@ static bool sema_expr_analyse_comp(SemaContext *context, Expr *expr, Expr *left,
UNREACHABLE
}
Expr **args = NULL;
if (overload->func_decl.signature.params[1]->type->canonical->type_kind == TYPE_POINTER)
Decl *first_param = overload->func_decl.signature.params[1];
if (first_param->type && first_param->type->canonical->type_kind == TYPE_POINTER)
{
expr_insert_addr(right);
}