From 60d96ca7b785c18d67834d311b5162a9f3173821 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Fri, 4 Jul 2025 02:43:49 +0200 Subject: [PATCH] Initialize pool correctly in print_backtrace. --- lib/std/core/builtin.c3 | 4 +++- releasenotes.md | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/std/core/builtin.c3 b/lib/std/core/builtin.c3 index 3c89bf8bf..d751c360f 100644 --- a/lib/std/core/builtin.c3 +++ b/lib/std/core/builtin.c3 @@ -99,11 +99,13 @@ macro anycast(any v, $Type) @builtin fn bool print_backtrace(String message, int backtraces_to_ignore) @if(env::NATIVE_STACKTRACE) => @stack_mem(0x1100; Allocator smem) { Allocator t = allocator::current_temp; + TempAllocator* t2 = allocator::top_temp; TempAllocator* new_t = allocator::new_temp_allocator(smem, 0x1000)!!; - allocator::current_temp = new_t; + allocator::current_temp = allocator::top_temp = new_t; defer { allocator::current_temp = t; + allocator::top_temp = t2; new_t.free(); } void*[256] buffer; diff --git a/releasenotes.md b/releasenotes.md index 3ba3d090c..b5cf172ba 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -24,6 +24,7 @@ - Inline `r / complex` for complex numbers fixed. - Const slice lengths were not always detected as constant. - Const slice indexing was not bounds checked. +- Initialize pool correctly in print_backtrace. ### Stdlib changes