For example, on line winapi.c:2080
lcb_call(parms,-1,0,REF_IDX); // pass it a new File reference
In wutils.c:119
BOOL call_lua_direct(lua_State *L, Ref ref, int idx, const char *text, int flags) {
if (flags & REF_IDX)
lua_pushvalue(L,idx);
idx == -1, but push_ref(L,ref) pushes the function to the top of the stack, making lua_pushvalue(L,idx) incorrect.