lua-users home
lua-l archive

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

hi all,

I want to post some more details for the previous message ^^
I just keep tracing my code... and I found out the following error 
when I jump into this lua function

int luaD_runprotected (lua_State *L, void (*f)(lua_State *, void *), 
void *ud) {
  StkId oldCbase = L->Cbase;
  StkId oldtop = L->top;
  struct lua_longjmp lj;
  int allowhooks = L->allowhooks;
  lj.status = 0;
  lj.previous = L->errorJmp;  /* chain new error handler */
  L->errorJmp = &lj;
  if (setjmp(lj.b) == 0)       <========= I got error in here
    (*f)(L, ud);
  else {  /* an error occurred: restore the state */
    L->allowhooks = allowhooks;
    L->Cbase = oldCbase;
    L->top = oldtop;
  L->errorJmp = lj.previous;  /* restore old error handler */
  return lj.status;

Since when my running to 
if (setjmp(lj.b) == 0)       
the value is equal to 3 but not 0... if there anything that I missed??