From f67ee0f315c82e08c115704c164c6942c478e148 Mon Sep 17 00:00:00 2001 From: slava Date: Wed, 15 Nov 2006 02:40:54 +0000 Subject: [PATCH] Kick off 0.87 with better callstack underflow handling --- TODO.FACTOR.txt | 1 - library/version.factor | 2 +- vm/factor.c | 2 -- vm/run.c | 7 ++++++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt index 203dd0616c..f20c11ef03 100644 --- a/TODO.FACTOR.txt +++ b/TODO.FACTOR.txt @@ -38,7 +38,6 @@ - allow rebinding styles - fix windows gcc issue - robustify stepper -- see if step back past a throw works -- empty callstack: should throw an exception instead of being a critical error + ui: diff --git a/library/version.factor b/library/version.factor index 8ec0ddbe43..24f16606fc 100644 --- a/library/version.factor +++ b/library/version.factor @@ -1,2 +1,2 @@ IN: kernel -: version "0.86" ; +: version "0.87" ; diff --git a/vm/factor.c b/vm/factor.c index 529b166a3f..6a7474dc8f 100644 --- a/vm/factor.c +++ b/vm/factor.c @@ -104,7 +104,5 @@ int main(int argc, char** argv) run_toplevel(); - critical_error("run_toplevel() returned due to empty callstack",0); - return 0; } diff --git a/vm/run.c b/vm/run.c index c8bcea5eee..bc1b8e0fae 100644 --- a/vm/run.c +++ b/vm/run.c @@ -69,7 +69,12 @@ void interpreter_loop(void) if(callframe_scan == callframe_end) { if(cs_bot - cs == CELLS) - return; + { + if(stack_chain->next) + return; + + general_error(ERROR_CS_UNDERFLOW,F,F,false); + } callframe_end = get(cs); callframe_scan = get(cs - CELLS);