package libtolua++5.1-dev
found 616557 tolua++/1.0.93-1
quit

Kalle Olavi Niemitalo <[email protected]> writes:

> In the tolua_isnumberarray, tolua_tofieldnumber, and
> tolua_pushfieldnumber calls, the second argument is wrong.
> It should be 1 rather than 2, because "numbers" is the first
> parameter in the Lua stack, even though it is the second
> parameter of the C++ function.

I think the attached patch fixes it; the resulting code looks OK.
I haven't added a test case though, so not setting the "patch" tag.
Also, as this patch affects the output, I suspect TOLUA_VERSION
should be changed to e.g. "tolua++-1.0.93-2 (Debian)", so that
people running tolua++ on other systems will understand why their
output differs from that generated with this patch.

tolua++ (1.0.93-1.kon.1) local; urgency=low

  * Local version!
  * Add patch debian/patches/state_with_array.patch:
    correct Lua stack location of arrays preceded by lua_State *
    (Closes: #616557)

Description: correct Lua stack location of arrays preceded by lua_State *
Author: Kalle Olavi Niemitalo <[email protected]>
Forwarded: no

--- tolua++-1.0.93.orig/src/bin/lua/function.lua	2008-11-11 20:14:49.000000000 +0200
+++ tolua++-1.0.93/src/bin/lua/function.lua	2011-03-05 20:53:46.000000000 +0200
@@ -161,7 +161,9 @@ function classFunction:supcode (local_co
   local i=1
   while self.args[i] do
    self.args[i]:getarray(narg)
-   narg = narg+1
+   if isbasic(self.args[i].type) ~= "state" then
+	   narg = narg+1
+   end
    i = i+1
   end
  end
@@ -288,7 +290,9 @@ function classFunction:supcode (local_co
    local i=1
    while self.args[i] do
     self.args[i]:setarray(narg)
-    narg = narg+1
+    if isbasic(self.args[i].type) ~= "state" then
+	    narg = narg+1
+    end
     i = i+1
    end
   end

Attachment: pgps9CVT5zmWy.pgp
Description: PGP signature

Reply via email to