Skip to content

Commit 0dae54b

Browse files
committed
FIX: Calling an action made by oneself crashes R3
fixes: metaeducation/rebol-issues#1051 and metaeducation/rebol-issues#1052
1 parent adeb508 commit 0dae54b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/core/c-function.c

+3
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@
197197
!IS_BLOCK(def)
198198
|| (len = VAL_LEN(def)) < 2
199199
|| !IS_BLOCK(spec = VAL_BLK(def))
200+
|| type == REB_ACTION //@@ https://github.com/rebol/rebol-issues/issues/1051
201+
|| type == REB_NATIVE
202+
|| type == REB_OP // may be implemented later!
200203
) return FALSE;
201204

202205
body = VAL_BLK_SKIP(def, 1);

src/tests/units/func-test.r3

+7
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ Rebol [
2222
fce: func[a [integer!]][probe a]
2323
--assert [probe a] = body-of :fce
2424

25+
--test-- "invalid MAKE"
26+
;@@ https://github.com/rebol/rebol-issues/issues/1052
27+
--assert error? try [make :read [[][]]]
28+
--assert error? try [make action! [[][]]]
29+
--assert error? try [make native! [[][]]]
30+
--assert error? try [make op! [[][]]]
31+
2532
===end-group===
2633

2734
~~~end-file~~~

0 commit comments

Comments
 (0)