mirror of
https://github.com/lua/lua.git
synced 2026-09-22 02:04:21 +00: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:
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)
|
||||
|
||||
Reference in New Issue
Block a user