diff --git a/releasenotes.md b/releasenotes.md index 2ef2c3b96..a55139929 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -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`. diff --git a/src/build/project_creation.c b/src/build/project_creation.c index 6506d6f0e..e4dc1a357 100644 --- a/src/build/project_creation.c +++ b/src/build/project_creation.c @@ -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); } diff --git a/src/compiler/llvm_codegen_expr.c b/src/compiler/llvm_codegen_expr.c index d0e7774f0..d0641c2de 100644 --- a/src/compiler/llvm_codegen_expr.c +++ b/src/compiler/llvm_codegen_expr.c @@ -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; diff --git a/src/compiler/sema_expr.c b/src/compiler/sema_expr.c index 88d6de851..86a6e9c7d 100644 --- a/src/compiler/sema_expr.c +++ b/src/compiler/sema_expr.c @@ -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); }