Roberto Ierusalimschy wrote:
The call to luaD_checkstack may reallocate the stack, invalidating p1 and p2. The stack always has some free slots (EXTRA_STACK) to allow those pushings.
Now I see... Thank you. AMDG, Antero Vipunen.