Skip to content

Commit

Permalink
ATRONIX: Do not set func word to be handle!
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
zsx authored and Oldes committed Mar 31, 2020
1 parent f4b30ea commit 66e47d5
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/core/c-do.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ void Do_Rebcode(REBVAL *v) {;}

static REBVAL *Func_Word(REBINT dsf)
{
static REBVAL val; // Safe: Lifetime is limited to passage to error object.
Init_Word(&val, VAL_WORD_SYM(DSF_WORD(dsf)));
return &val;
return DSF_WORD(dsf);
}


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

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

0 comments on commit 66e47d5

Please sign in to comment.