[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Bus error on MacOS
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Sat, 4 May 2013 08:14:07 -0300
This also works but I still don't know why it should be necessary:
static int aux_close (lua_State *L) {
LStream *p = tolstream(L);
lua_CFunction cf = p->closef;
int rc = (cf)(L); /* close it */
p->closef = NULL; /* mark stream as closed */
return rc;
}
It seems to be an optimization problem because the original code below
works fine with -O0.
static int aux_close (lua_State *L) {
LStream *p = tolstream(L);
lua_CFunction cf = p->closef;
p->closef = NULL; /* mark stream as closed */
return (*cf)(L); /* close it */
}