File tree 2 files changed +18
-4
lines changed
2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change 814
814
REBINT * binds = WORDS_HEAD (Bind_Table ); // GC safe to do here
815
815
REBCNT n ;
816
816
REBFLG selfish = !IS_SELFLESS (frame );
817
-
818
- CHECK_STACK (& n );
817
+ REBVAL * val ;
819
818
820
819
for (; NOT_END (value ); value ++ ) {
821
820
if (ANY_WORD (value )) {
840
839
}
841
840
}
842
841
}
843
- else if ((ANY_BLOCK (value ) || IS_MAP (value )) && (mode & BIND_DEEP ))
842
+ else if ((ANY_BLOCK (value ) || IS_MAP (value )) && (mode & BIND_DEEP )) {
843
+ // Recursion check: (variation of: Find_Same_Block(MOLD_LOOP, value))
844
+ for (val = BLK_HEAD (MOLD_LOOP ); NOT_END (val ); val ++ ) {
845
+ if (VAL_SERIES (val ) == VAL_SERIES (value )) return ;
846
+ }
847
+ val = Append_Value (MOLD_LOOP );
848
+ Set_Block (val , VAL_SERIES (value ));
844
849
Bind_Block_Words (frame , VAL_BLK_DATA (value ), mode );
850
+ Remove_Last (MOLD_LOOP );
851
+ }
845
852
else if ((IS_FUNCTION (value ) || IS_CLOSURE (value )) && (mode & BIND_FUNC ))
846
853
Bind_Block_Words (frame , BLK_HEAD (VAL_FUNC_BODY (value )), mode );
847
854
}
855
+
848
856
}
849
857
850
858
Original file line number Diff line number Diff line change @@ -237,7 +237,13 @@ foreach [n s] system/schemes [
237
237
obj: make object! [x: 10 ]
238
238
blk: copy [x]
239
239
append /only blk blk
240
- --assert all [error? e: try [bind block obj] e/id = 'stack-overflow]
240
+ --assert all [
241
+ block? try [bind blk obj]
242
+ same? blk/1 blk/2/1
243
+ 10 == get blk/1
244
+ 10 == get blk/2/1
245
+ 10 == get blk/2/2/1
246
+ ]
241
247
242
248
===end-group===
243
249
You can’t perform that action at this time.
0 commit comments