Skip to content

Commit 37c7357

Browse files
committed
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.
1 parent c22654b commit 37c7357

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
@@ -72,9 +72,7 @@ void Do_Rebcode(REBVAL *v) {;}
7272

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

8078

@@ -340,9 +338,7 @@ void Trace_Arg(REBINT num, REBVAL *arg, REBVAL *path)
340338

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

0 commit comments

Comments
 (0)