Permalink
Browse files

bug fix for array conversions

  • Loading branch information...
1 parent ea870b5 commit 63ff14dff7f0a137bb8be6afad6288dcbe9e2d94 @probablycorey probablycorey committed Nov 11, 2009
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/wax_helpers.m
View
4 lib/wax_helpers.m
@@ -382,6 +382,7 @@ void wax_fromInstance(lua_State *L, id instance) {
case LUA_TTABLE: {
BOOL dictionary = NO;
+ lua_pushvalue(L, stackIndex); // Push the table reference on the top
lua_pushnil(L); /* first key */
while (!dictionary && lua_next(L, -2)) {
if (lua_type(L, -2) != LUA_TNUMBER) {
@@ -418,7 +419,8 @@ void wax_fromInstance(lua_State *L, id instance) {
free(object);
}
}
-
+
+ lua_pop(L, 1); // Pop the table reference off
break;
}

0 comments on commit 63ff14d

Please sign in to comment.