Scheme frame objects hold relative stack offsets
[bpt/guile.git] / libguile / stacks.c
index 20b67ef..4b3016a 100644 (file)
@@ -258,9 +258,10 @@ SCM_DEFINE (scm_make_stack, "make-stack", 1, 0, 1,
       cont = scm_i_capture_current_stack ();
       c = SCM_VM_CONT_DATA (cont);
 
-      frame = scm_c_make_frame (cont, c->fp + c->reloc,
-                                c->sp + c->reloc, c->ra,
-                                c->reloc);
+      frame = scm_c_make_frame (cont,
+                                (c->fp + c->reloc) - c->stack_base,
+                                (c->sp + c->reloc) - c->stack_base,
+                                c->ra);
     }
   else if (SCM_VM_FRAME_P (obj))
     frame = obj;