diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-07-07 18:03:48 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-07-07 18:03:48 -0300 |
commit | eb41999461b6f428186c55abd95f4ce1a76217d5 (patch) | |
tree | 577e56c4ad5999b34966232b1e2a2bf9a63f7cc2 /lvm.c | |
parent | 314c6057b785cd94ac88905ccfce61724107d66b (diff) | |
download | lua-eb41999461b6f428186c55abd95f4ce1a76217d5.tar.gz lua-eb41999461b6f428186c55abd95f4ce1a76217d5.tar.bz2 lua-eb41999461b6f428186c55abd95f4ce1a76217d5.zip |
Fixed bugs of stack reallocation x GC
Macro 'checkstackGC' was doing a GC step after resizing the stack;
the GC could shrink the stack and undo the resize. Moreover, macro
'checkstackp' also does a GC step, which could remove the preallocated
CallInfo when calling a function. (Its name has been changed to
'checkstackGCp' to emphasize that it calls the GC.)
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1634,7 +1634,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { | |||
1634 | while (!ttisfunction(s2v(ra))) { /* not a function? */ | 1634 | while (!ttisfunction(s2v(ra))) { /* not a function? */ |
1635 | luaD_tryfuncTM(L, ra); /* try '__call' metamethod */ | 1635 | luaD_tryfuncTM(L, ra); /* try '__call' metamethod */ |
1636 | b++; /* there is now one extra argument */ | 1636 | b++; /* there is now one extra argument */ |
1637 | checkstackp(L, 1, ra); | 1637 | checkstackGCp(L, 1, ra); |
1638 | } | 1638 | } |
1639 | if (!ttisLclosure(s2v(ra))) { /* C function? */ | 1639 | if (!ttisLclosure(s2v(ra))) { /* C function? */ |
1640 | luaD_call(L, ra, LUA_MULTRET); /* call it */ | 1640 | luaD_call(L, ra, LUA_MULTRET); /* call it */ |