LJ_GC64: Always snapshot functions for non-base frames.

Reported by Arseny Vakhrushev.
Analysis and fix contributed by Peter Cawley.
This commit is contained in:
Mike Pall
2020-08-27 18:05:32 +02:00
parent 94d4abcca9
commit ff1e72acea
2 changed files with 8 additions and 2 deletions

View File

@@ -211,6 +211,7 @@ static TRef getcurrf(jit_State *J)
{
if (J->base[-1-LJ_FR2])
return J->base[-1-LJ_FR2];
/* Non-base frame functions ought to be loaded already. */
lj_assertJ(J->baseslot == 1+LJ_FR2, "bad baseslot");
return sloadt(J, -1-LJ_FR2, IRT_FUNC, IRSLOAD_READONLY);
}