Fix unwrapping of LUA lightuserdata type. Add test case.

This commit is contained in:
Ryan Nevell 2020-02-17 08:45:42 -08:00
commit 33c59614fc
4 changed files with 29 additions and 0 deletions

View file

@ -1765,6 +1765,11 @@ SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State *L,int index,void **ptr,swig_type
*ptr=0;
return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK;
}
if (lua_islightuserdata(L,index))
{
*ptr=lua_touserdata(L,index);
return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK;
}
usr=(swig_lua_userdata*)lua_touserdata(L,index); /* get data */
if (usr)
{