[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Question regarding Protect() in lvm.c
- From: Roberto Ierusalimschy <roberto@...>
- Date: Sun, 22 Feb 2015 13:37:05 -0300
> It seems that the stack can be reallocated if there is a function
> call.
A function call in Lua (not in C).
> So then in the following snippet is it okay to just protect the
> call to luaV_equalobj()?
>
> case OP_EQ: {
> TValue *rb = RKB(i);
> TValue *rc = RKC(i);
> Protect(
> if (cast_int(luaV_equalobj(L, rb, rc)) != GETARG_A(i))
> ci->u.l.savedpc++;
> else
> donextjump(ci);
> )
> } break;
It would be, but the current 'Protect' macro only acceps commands,
not expressions.
-- Roberto