Merge branch 'master' of git://factorcode.org/git/factor

release
U-C4\Administrator 2007-10-06 22:27:13 -05:00
commit 7b95e1fedf
4 changed files with 18 additions and 2 deletions

View File

@ -40,6 +40,16 @@ F_CALLSTACK *allot_callstack(CELL size)
return callstack; return callstack;
} }
F_STACK_FRAME *fix_callstack_top(F_STACK_FRAME *top, F_STACK_FRAME *bottom)
{
F_STACK_FRAME *frame = bottom - 1;
while(frame >= top)
frame = frame_successor(frame);
return frame + 1;
}
/* We ignore the topmost frame, the one calling 'callstack', /* We ignore the topmost frame, the one calling 'callstack',
so that set-callstack doesn't get stuck in an infinite loop. so that set-callstack doesn't get stuck in an infinite loop.

View File

@ -5,6 +5,7 @@ F_FASTCALL __attribute__((noinline)) void save_callstack_top(F_STACK_FRAME *call
typedef void (*CALLSTACK_ITER)(F_STACK_FRAME *frame); typedef void (*CALLSTACK_ITER)(F_STACK_FRAME *frame);
F_STACK_FRAME *fix_callstack_top(F_STACK_FRAME *top, F_STACK_FRAME *bottom);
void iterate_callstack(CELL top, CELL bottom, CALLSTACK_ITER iterator); void iterate_callstack(CELL top, CELL bottom, CALLSTACK_ITER iterator);
void iterate_callstack_object(F_CALLSTACK *stack, CALLSTACK_ITER iterator); void iterate_callstack_object(F_CALLSTACK *stack, CALLSTACK_ITER iterator);
F_STACK_FRAME *frame_successor(F_STACK_FRAME *frame); F_STACK_FRAME *frame_successor(F_STACK_FRAME *frame);

View File

@ -35,7 +35,12 @@ void throw_error(CELL error, F_STACK_FRAME *callstack_top)
Errors thrown from Factor code, or signal handlers, pass the Errors thrown from Factor code, or signal handlers, pass the
actual stack pointer at the time, since the saved pointer is actual stack pointer at the time, since the saved pointer is
not necessarily up to date at that point. */ not necessarily up to date at that point. */
if(!callstack_top) if(callstack_top)
{
callstack_top = fix_callstack_top(
stack_chain->callstack_bottom,callstack_top);
}
else
callstack_top = stack_chain->callstack_top; callstack_top = stack_chain->callstack_top;
throw_impl(userenv[BREAK_ENV],callstack_top); throw_impl(userenv[BREAK_ENV],callstack_top);

View File

@ -29,7 +29,7 @@ long exception_handler(PEXCEPTION_POINTERS pe)
CONTEXT *c = (CONTEXT*)pe->ContextRecord; CONTEXT *c = (CONTEXT*)pe->ContextRecord;
if(in_code_heap_p(c->Eip)) if(in_code_heap_p(c->Eip))
signal_callstack_top = (void *)(c->Esp - CELLS); signal_callstack_top = (void *)c->Esp;
else else
signal_callstack_top = NULL; signal_callstack_top = NULL;