Skip to content

Commit 66e47d5

Browse files
zsxOldes
authored andcommitted
ATRONIX: Do not set func word to be handle!
There doesn't seem to be a reason to do this (any more?). Just call Init_Word and GC will be happy. This removes an additional static word for error reporting. (cherry picked from commit 37c7357)
1 parent f4b30ea commit 66e47d5

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/core/c-do.c

+2-6
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,7 @@ void Do_Rebcode(REBVAL *v) {;}
7373

7474
static REBVAL *Func_Word(REBINT dsf)
7575
{
76-
static REBVAL val; // Safe: Lifetime is limited to passage to error object.
77-
Init_Word(&val, VAL_WORD_SYM(DSF_WORD(dsf)));
78-
return &val;
76+
return DSF_WORD(dsf);
7977
}
8078

8179

@@ -341,9 +339,7 @@ void Trace_Arg(REBINT num, REBVAL *arg, REBVAL *path)
341339

342340
// Save WORD for function and fake frame for relative arg lookup:
343341
tos++;
344-
VAL_SET(tos, REB_TYPESET); // Was REB_WORD and REB_HANDLE, but GC does not like bad fields.
345-
VAL_WORD_SYM(tos) = word ? word : SYM__APPLY_;
346-
VAL_WORD_INDEX(tos) = -1; // avoid GC access to invalid FRAME above
342+
Init_Word(tos, word ? word : SYM__APPLY_);
347343
if (func) {
348344
VAL_WORD_FRAME(tos) = VAL_FUNC_ARGS(func);
349345
// Save FUNC value for safety (spec, args, code):

0 commit comments

Comments
 (0)