Missing upvalue in make_range
James Lloyd <[email protected]>
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <[email protected]> |
Hello list,
I've recently upgraded to 0.8 (I know that 0.9 is now available) and
have found a bug in the implementation of make_range in
iterator_policy.hpp, line 52. The iterator::destroy function wants an
upvalue that is never pushed:
template <class Iterator>
int make_range(lua_State* L, Iterator first, Iterator last)
{
void* storage = lua_newuserdata(L,
sizeof(iterator<Iterator>));
lua_newtable(L);
// should lua_pushvalue(L, -2);
lua_pushcclosure(L, iterator<Iterator>::destroy, 0); //
should be 1
lua_setfield(L, -2, "__gc");
lua_setmetatable(L, -2);
lua_pushcclosure(L, iterator<Iterator>::next, 1);
new (storage) iterator<Iterator>(first, last);
return 1;
}
This is still in the 0.9 download.
Cheers,
James
--
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user
James Lloyd.png
(image/png, 10.2 KB) - not displayed