lua-users home
lua-l archive

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


Hi!

    for (j = 1; j<1000;j++)
     status = lua_cpcall(LL, do_stuff, NULL); /* does not panic */
    switch(status)
    {
 /* ...*/
    }

I believe you meant either

    for (j = 1; j<1000;j++)
    {
      status = lua_cpcall(LL, do_stuff, NULL); /* does not panic */
      switch(status)
      {
      /* ...*/
      }
    }

Or

    for (j = 1; j<1000;j++)
    {
     status = lua_cpcall(LL, do_stuff, NULL); /* does not panic */
     if (status != 0)
       break;
    }

    switch(status)
    {
 /* ...*/
    }

Before segfault your code fails a number of times with LUA_ERRMEM.

HTH,
Alexander.