lua-users home
lua-l archive

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

On Mon, Nov 17, 2003 at 09:02:09AM -0800, Curt Carpenter wrote:
> I have found a few Lua crashes that would have been caught earlier, in a
> completely unrelated call stack, if Lua asserts were enabled. Try that.
> Oddly, the docs don't mention this, or even what you have to define to
> get asserts working. You need to define lua_assert such that it exists
> when including llimits.h and lualib.h.

this is how i enable all Lua asserts in Lua 5.0.

	#ifndef api_check
	#define api_check(L, o)         /*{ assert(o); }*/

in lapi.c to

	#ifndef api_check
	#define api_check(L, o)         { assert(o); }

and change MYCFLAGS in lua-5.0/config to

	MYCFLAGS= -O2 -DLUA_USER_H='<assert.h>' -Dlua_assert=assert