lua-users home
lua-l archive

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


I'm trying to make it so when one changes LUA_NUMBER from double to
long, the interpreter handles divide by zero and modulo by zero
gracefully.  The macros luai_numdiv and luai_nummod are used in the VM
and the constant folding function.  In one context, struct lua_State
*L is defined, but not in the other.  This variable is used by the
error reporting routines, such as, luaG_runerror.  At this point, all
I can think to do is to introduce two macros for each operation, one
that makes use of L, which is available in the VM, and the other which
makes no provision for the second argument being zero.  Not very
satisfying.  Better ideas would be greatly appreciated.

John