From ddad4bb39069bd6582685348de2acb7e89b1c81e Mon Sep 17 00:00:00 2001 From: Oldes Huhuman Date: Wed, 17 Apr 2024 11:44:11 +0200 Subject: [PATCH] FIX: crash when used `bind` on recursive data resolves: https://github.com/Oldes/Rebol-issues/issues/2278 --- src/core/c-frame.c | 2 ++ src/tests/units/crash-test.r3 | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/core/c-frame.c b/src/core/c-frame.c index abd2cdf597..d5ccfdb16a 100644 --- a/src/core/c-frame.c +++ b/src/core/c-frame.c @@ -815,6 +815,8 @@ REBCNT n; REBFLG selfish = !IS_SELFLESS(frame); + CHECK_STACK(&n); + for (; NOT_END(value); value++) { if (ANY_WORD(value)) { //Print("Word: %s", Get_Sym_Name(VAL_WORD_CANON(value))); diff --git a/src/tests/units/crash-test.r3 b/src/tests/units/crash-test.r3 index 953c5460a0..3a1caa6c6d 100644 --- a/src/tests/units/crash-test.r3 +++ b/src/tests/units/crash-test.r3 @@ -232,6 +232,13 @@ foreach [n s] system/schemes [ ;@@ https://github.com/Oldes/Rebol-issues/issues/767 --assert same? :greater? copy :greater? ;-no crash +--test-- "recursive bind" + ;@@ https://github.com/Oldes/Rebol-issues/issues/2278 + obj: make object! [x: 10] + blk: copy [x] + append/only blk blk + --assert all [error? e: try [bind block obj] e/id = 'stack-overflow] + ===end-group=== ~~~end-file~~~ \ No newline at end of file