lua-users home
lua-l archive

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

Ok, I found the problem. I was calling lua_remove with a negative index
too low. Of course the actual crash was much later. I was surprised to
discover that api_check (which would have immediately caught the error)
actually does nothing:
#define api_check(L, o)         /*{ assert(o); }*/

Was that intentional? If it's commented for perf reasons (asserts don't
do anything by defauylt anyway) maybe it should be mentioned in the docs
that you better uncomment that if you want parameter validation,
otherwise any parameter errors will not be checked and memory corruption
can result. Seems like an important issue. Certainly would have saved me
many hours.