Skip to content

Commit 700045e

Browse files
committed
FIX: minor Expand_Stack modification
1. Using `Trap_Stack` instead of `Trap0(RE_STACK_OVERFLOW)` as the second one displays `near` information, which may not be good to show. 2. Don't try to expand stack over limit. Related to: Oldes/Rebol-issues#1252
1 parent 0d9dd37 commit 700045e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/core/c-do.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,11 @@ static REBVAL *Func_Word(REBINT dsf)
9999
**
100100
***********************************************************************/
101101
{
102-
if (SERIES_REST(DS_Series) >= STACK_LIMIT) Trap0(RE_STACK_OVERFLOW);
102+
if (SERIES_REST(DS_Series) >= STACK_LIMIT) Trap_Stack();
103103
DS_Series->tail = DSP+1;
104+
if((amount + SERIES_REST(DS_Series)) >= STACK_LIMIT) {
105+
amount = STACK_LIMIT - SERIES_REST(DS_Series) - 1;
106+
}
104107
Extend_Series(DS_Series, amount);
105108
DS_Base = BLK_HEAD(DS_Series);
106109
Debug_Fmt(BOOT_STR(RS_STACK, 0), DSP, SERIES_REST(DS_Series));

0 commit comments

Comments
 (0)