ref: 02fe9797be10453dd75761640bace0e809cf7182
parent: e8d69c4cd659cee7e94e8fb024a0cd26c05d277f
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Thu Nov 7 16:25:50 EST 2024
_stacktrace: move declarations inside the loop
--- a/flisp.c
+++ b/flisp.c
@@ -1794,13 +1794,13 @@
static value_t
_stacktrace(uint32_t top)
{
- uint32_t bp, sz;
- value_t v, lst = NIL;
+ value_t lst = NIL;
+
fl_gc_handle(&lst);
while(top > 0){
- sz = Stack[top-3]+1;
- bp = top-5-sz;
- v = alloc_vector(sz, 0);
+ uint32_t sz = Stack[top-3]+1;
+ uint32_t bp = top-5-sz;
+ value_t v = alloc_vector(sz, 0);
if(Stack[top-1] /*captured*/){
vector_elt(v, 0) = Stack[bp];
memmove(&vector_elt(v, 1),