get_class_info

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

get_class_info

Alexander Gladysh
Hi, all!

I'm using recent Luabind CVS and Lua 5.1.1.

Looks like undocumeted luabind::get_class_info() function does not
check its argument to be actual Luabind object. So this call crashes
Luabind with Access Violation:

  local t = 123
  class_info(t)

Is it possible to check from Lua that given variable holds Luabind
object (out-of-the-box, without writing some C++-function)?

Any replies are welcome. :(

Thanks in advance,
Alexander.

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: get_class_info

Alexander Gladysh
> Looks like undocumeted luabind::get_class_info() function does not
> check its argument to be actual Luabind object. So this call crashes
> Luabind with Access Violation:

>  local t = 123
>  class_info(t)

Furthermore, it crashes if I give it Luabind-bound class (and not
object, this is a userdata too). I mean code like this (have not
compiled it though, and I've found this problem on larger piece of
code):

  luabind::class_< foo, boost::shared_ptr<foo> >("foo_t"); // C++

  class_info(foo_t) -- Lua. This crashes with Access Violation.

Perhaps this static_cast could be replaced with something more safe... :(

  detail::object_rep* obj =
static_cast<detail::object_rep*>(lua_touserdata(L, -1));

(class_info.cpp, line 38)

Thanks in advance,
Alexander.

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user