mirror of
https://github.com/lua/lua
synced 2026-09-26 16:17:11 +03:00
Macro 'luaC_condGC' should call pre/pos only once
With test option HARDMEMTESTS defined, luaC_condGC was calling pre and pos twice. That made macro checkGC set the stack top before the GC step and then again before the full collection, but the previous step could invalidate the pointer used to set top.
This commit is contained in:
parent
7579fc9d7e
commit
c0adc5f8a5
1 changed files with 3 additions and 2 deletions
5
lgc.h
5
lgc.h
|
|
@ -231,8 +231,9 @@
|
|||
#endif
|
||||
|
||||
#define luaC_condGC(L,pre,pos) \
|
||||
{ if (G(L)->GCdebt <= 0) { pre; luaC_step(L); pos;}; \
|
||||
condchangemem(L,pre,pos,0); }
|
||||
{ if (G(L)->GCdebt <= 0) \
|
||||
{ pre; luaC_step(L); condchangemem(L,{},{},0); pos;} \
|
||||
else condchangemem(L,pre,pos,0); }
|
||||
|
||||
/* more often than not, 'pre'/'pos' are empty */
|
||||
#define luaC_checkGC(L) luaC_condGC(L,(void)0,(void)0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue