From 686ba5fd719a24c64a97fa13d98809db202e8294 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Mon, 13 Nov 2023 01:08:52 +0100 Subject: [PATCH] Experiments --- src/compiler/llvm_codegen_function.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/llvm_codegen_function.c b/src/compiler/llvm_codegen_function.c index e8eb7652c..b9f9a08d3 100644 --- a/src/compiler/llvm_codegen_function.c +++ b/src/compiler/llvm_codegen_function.c @@ -531,7 +531,7 @@ void llvm_emit_body(GenContext *c, LLVMValueRef function, FunctionPrototype *pro llvm_emit_stacktrace_definitions(c); c->builder = prev_builder; } - else if (c->debug.enable_stacktrace) + else if (c->debug.enable_stacktrace && !c->debug.stack_init_fn) { const char *name = ".stacktrace_current"; LLVMValueRef current_stack = c->debug.current_stack_ptr = llvm_add_global_raw(c, name, c->ptr_type, 0); @@ -575,6 +575,7 @@ void llvm_emit_body(GenContext *c, LLVMValueRef function, FunctionPrototype *pro LLVMBuildRetVoid(c->builder); LLVMDisposeBuilder(c->builder); c->builder = NULL; + c->builder = prev_builder; } c->opt_var = NULL; c->catch_block = NULL;