]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix callstack overflow handling
authorslava <slava@factorcode.org>
Fri, 3 Nov 2006 21:14:53 +0000 (21:14 +0000)
committerslava <slava@factorcode.org>
Fri, 3 Nov 2006 21:14:53 +0000 (21:14 +0000)
vm/data_gc.c
vm/run.h
vm/stack.h

index 10dbcb27b95dde52268a3ca53b0a483a4f0c22bd..f6d8c32b60acfa71d19daabc877d3e13feb1f859 100644 (file)
@@ -317,6 +317,7 @@ void collect_roots(void)
        copy_handle(&bignum_zero);
        copy_handle(&bignum_pos_one);
        copy_handle(&bignum_neg_one);
+       
        collect_callframe_triple(&callframe,&callframe_scan,&callframe_end);
 
        collect_stack(extra_roots_region,extra_roots);
index 250f9aead3d37901f7381c45e1ba183305e72986..7a93750747b74c45cea6bf8dece1a0d22e80d546 100644 (file)
--- a/vm/run.h
+++ b/vm/run.h
@@ -118,7 +118,6 @@ INLINE CELL type_of(CELL tagged)
 
 DEFPUSHPOP(d,ds)
 DEFPUSHPOP(r,rs)
-DEFPUSHPOP(c,cs)
 
 void call(CELL quot);
 
index 2ad3257cc4e28534ae64718b1d883343774b3654..d913e5ed00827564e988287e844afafead5e4b77 100644 (file)
@@ -48,8 +48,8 @@ CELL ds_size, rs_size, cs_size;
 #define rs_bot ((CELL)(stack_chain->retain_region->start))
 #define cs_bot ((CELL)(stack_chain->call_region->start))
 
-#define STACK_UNDERFLOW(stack,region) ((stack) + CELLS < (region)->start)
-#define STACK_OVERFLOW(stack,region) ((stack) + CELLS >= (region)->start + (region)->size)
+#define STACK_UNDERFLOW(stack,region) ((stack) + 3 * CELLS < (region)->start)
+#define STACK_OVERFLOW(stack,region) ((stack) + 3 * CELLS >= (region)->start + (region)->size)
 
 void reset_datastack(void);
 void reset_retainstack(void);