lua-users home
lua-l archive

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


> There is a bug in the code.  The value passed as tname is a pointer to an 
> 'int' not a string, if typeerror() is called it will try to print that 'int' 
> as a string.

Yes, I noticed that after posting. ;-) Thanks for reporting.
Moreover, we need to add this before the #defines:
#undef  luaL_getmetatable

> 'mykey' could be changed to a string it doesn't have to be an 
> 'int'.  Also the value of the string could be provided by the code that 
> includes udata.c using a #define.  See the attached fixed version (un-tested).

Actually, luaL_checkudatap should be changed to accept the original
user string as well, to be used in the error message.