Skip to content

Commit ddad4bb

Browse files
committed
FIX: crash when used bind on recursive data
resolves: Oldes/Rebol-issues#2278
1 parent cfe4ffc commit ddad4bb

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/core/c-frame.c

+2
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,8 @@
815815
REBCNT n;
816816
REBFLG selfish = !IS_SELFLESS(frame);
817817

818+
CHECK_STACK(&n);
819+
818820
for (; NOT_END(value); value++) {
819821
if (ANY_WORD(value)) {
820822
//Print("Word: %s", Get_Sym_Name(VAL_WORD_CANON(value)));

src/tests/units/crash-test.r3

+7
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,13 @@ foreach [n s] system/schemes [
232232
;@@ https://github.com/Oldes/Rebol-issues/issues/767
233233
--assert same? :greater? copy :greater? ;-no crash
234234

235+
--test-- "recursive bind"
236+
;@@ https://github.com/Oldes/Rebol-issues/issues/2278
237+
obj: make object! [x: 10]
238+
blk: copy [x]
239+
append/only blk blk
240+
--assert all [error? e: try [bind block obj] e/id = 'stack-overflow]
241+
235242
===end-group===
236243

237244
~~~end-file~~~

0 commit comments

Comments
 (0)