lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 22 February 2015 at 16:37, Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
>> 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.

Okay thanks.

Regards
Dibyendu