Skip to content

Commit

Permalink
FIX: Calling an action made by oneself crashes R3
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Apr 26, 2019
1 parent adeb508 commit 0dae54b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/c-function.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@
!IS_BLOCK(def)
|| (len = VAL_LEN(def)) < 2
|| !IS_BLOCK(spec = VAL_BLK(def))
|| type == REB_ACTION //@@ https://github.com/rebol/rebol-issues/issues/1051
|| type == REB_NATIVE
|| type == REB_OP // may be implemented later!
) return FALSE;

body = VAL_BLK_SKIP(def, 1);
Expand Down
7 changes: 7 additions & 0 deletions src/tests/units/func-test.r3
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ Rebol [
fce: func[a [integer!]][probe a]
--assert [probe a] = body-of :fce

--test-- "invalid MAKE"
;@@ https://github.com/rebol/rebol-issues/issues/1052
--assert error? try [make :read [[][]]]
--assert error? try [make action! [[][]]]
--assert error? try [make native! [[][]]]
--assert error? try [make op! [[][]]]

===end-group===

~~~end-file~~~

0 comments on commit 0dae54b

Please sign in to comment.