win64: defensive check for stack-trace collection

This commit is contained in:
Matthew Flatt 2012-09-13 10:53:24 -06:00
parent 7a772ce09d
commit ab251eaca6

View File

@ -229,7 +229,11 @@ Scheme_Object *scheme_native_stack_trace(void)
if (name) {
/* Unwind manually */
uintptr_t *fp = (uintptr_t *)ctx.Rbp;
if (SCHEME_FALSEP(name) || SCHEME_VOIDP(name)) {
if (!(STK_COMP((uintptr_t)fp, stack_end)
&& STK_COMP(stack_start, (uintptr_t)fp))) {
/* out-of-range frame pointer; give up */
break;
} else if (SCHEME_FALSEP(name) || SCHEME_VOIDP(name)) {
/* "quick" call convention */
if (SCHEME_VOIDP(name)) {
/* JIT_LOCAL2 has the next return address */