Re: Bug in cpcall
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Bug in cpcall
- From: "Alexander Gladysh" <agladysh@...>
- Date: 2008年3月11日 12:39:04 +0300
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.