mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
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:
@@ -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`.
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user