--- src/lprefix.h.orig 2018-07-14 23:49:59.792621000 +0100 +++ src/lprefix.h 2018-07-14 23:50:20.856546000 +0100 @@ -7,6 +7,8 @@ #ifndef lprefix_h #define lprefix_h +#include +#define lua_assert(c_) assert(c_) /* ** Allows POSIX/XSI stuff --- src/lgc.c.orig 2017-08-31 16:15:27 UTC +++ src/lgc.c @@ -984,7 +984,6 @@ static l_mem atomic (lua_State *L) { l_mem work; GCObject *origweak, *origall; GCObject *grayagain = g->grayagain; /* save original list */ - lua_assert(g->ephemeron == NULL && g->weak == NULL); lua_assert(!iswhite(g->mainthread)); g->gcstate = GCSinsideatomic; g->GCmemtrav = 0; /* start counting work */ @@ -1061,6 +1060,7 @@ static lu_mem singlestep (lua_State *L) } case GCSatomic: { lu_mem work; + lua_assert(g->ephemeron == NULL && g->weak == NULL); propagateall(g); /* make sure gray list is empty */ work = atomic(L); /* work is what was traversed by 'atomic' */ entersweep(L);