lua-users home
lua-l archive

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


Speaking of crash prevention -
Any plans to introduce an optional cycle limiter, to guard against infinite loops and things like that? Such that I can say: lua_setcycles(50); lua_dostring(...); and at 50 cycles in, it will yield back to the function that called it with a LUA_YIELD return code, at which point I can call lua_continue() or do something else...

Just a thought...
-G

At 05:28 PM 3/21/2002 -0300, you wrote:
> Can't I do all those things from inside a C function as well? Untested code:

If you want to crash your program from C, you don't need Lua:

  memset((void *)0, 0, INT_MAX);

The point is to avoid crashing your program from Lua. Whatever you
do in Lua, you cannot crash your program, even if you want (bugs
notwithstanding). Actually, more than crashing a program, we want to
make sure that Lua has no "buffer-overflow" bugs and other nasty things
like that.

-- Roberto