From 0dae54bbe2b6d3c6a59edebec0ff0035b69f1a9f Mon Sep 17 00:00:00 2001 From: Oldes Date: Fri, 26 Apr 2019 11:06:35 +0200 Subject: [PATCH] FIX: Calling an action made by oneself crashes R3 fixes: https://github.com/rebol/rebol-issues/issues/1051 and https://github.com/rebol/rebol-issues/issues/1052 --- src/core/c-function.c | 3 +++ src/tests/units/func-test.r3 | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/src/core/c-function.c b/src/core/c-function.c index 8dd586734f..cab84a44c1 100644 --- a/src/core/c-function.c +++ b/src/core/c-function.c @@ -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); diff --git a/src/tests/units/func-test.r3 b/src/tests/units/func-test.r3 index 3a44ef1655..a46b5d35fd 100644 --- a/src/tests/units/func-test.r3 +++ b/src/tests/units/func-test.r3 @@ -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~~~