lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>    lua 5.4.4 lvm.c:794
>    static void pushclosure(...) {
>      ...
>      ncl->p = p;   /* it need barrier */
>      luaC_objbarrier(L, ncl, p) /* fix BUG */
>      ...
>    }
>    when I test my modified code on GC,I find it cause crash.

Are you sure? The sequence is this:

    LClosure *ncl = luaF_newLclosure(L, nup);
    ncl->p = p;
    luaC_objbarrier(L, ncl, p);  /* ??? */
    
As 'ncl' was just created, it must be white; but 'luaC_objbarrier' is
a macro that would only do anything if 'ncl' was black. That is,
the barrier would never be activated.

-- Roberto