lua-users home
lua-l archive

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


> https://github.com/lua/lua/blob/6e1aec7a677a9891f2f8ca57e039d9984fdc69bc/lvm.c#L1085
> 
> 
>   lua_assert(isIT(i) || (L->top = base));
> 
> should be:
> 
>  lua_assert(isIT(i) || (L->top == base));
> 
> I think.

Strange as it is, this is correct. See previous comment:

    /* invalidate top for instructions not expecting it */
    lua_assert(isIT(i) || (L->top = base));

The idea is that only opcodes marked with 'isIT' should use L->top.
To test this, all other opcodes set L->top to an "absurd" value
(base, so that it is out of the range of valid registers) to force
some error if it is used.

-- Roberto