From fbcfed79b82b5db55e688fd21580b8d934579bff Mon Sep 17 00:00:00 2001 From: Musa Mahmood Date: Sun, 7 Dec 2025 10:30:37 -0500 Subject: [PATCH] Another major bugfix in `copy_error` --- lib/Base/ErrorType.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Base/ErrorType.cpp b/lib/Base/ErrorType.cpp index 94514bd..39a98dd 100644 --- a/lib/Base/ErrorType.cpp +++ b/lib/Base/ErrorType.cpp @@ -104,7 +104,9 @@ void Log_Error_2 (string file_path, string function_name, s32 line_number, Error Error* copy_error (Thread_Context* tctx, Error* old_error) { push_arena(tctx->error_arena); - Error* error = new_error(old_error->severity, to_string(old_error)); + string error_string_copy = copy_string(to_string(old_error)); + + Error* error = new_error(old_error->severity, error_string_copy); error->thread_id = old_error->thread_id; error->source_line = old_error->source_line; @@ -221,12 +223,10 @@ ArrayView get_all_errors (Thread_Context* tctx) { current_error = current_error->next_error; } - // #TODO(Low priority): also recurse through child threads? // NOTE: I don't think we actually want this, because we merge // our errors on the main thread when we thread_deinit. - // for_each(t, tctx->child_threads) { - // } + // for_each(t, tctx->child_threads) { } return error_array; }