diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-04-03 15:27:06 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-04-03 15:27:06 -0300 |
| commit | 1ea6e8064cdfa13ba2298783eb87de58568ea998 (patch) | |
| tree | 763be2cfdbc8de6fd0fb1366a93473b49b5dfeb2 /opcode.c | |
| parent | c1746340c3fc2128c0ad4f1b356820064c722e85 (diff) | |
| download | lua-github-1ea6e8064cdfa13ba2298783eb87de58568ea998.tar.gz | |
"setintmethod" returns old method (to be coerent with seterrormethod).
BUG: wrong pointer arithmetic (index out of range when comparing).
obs: version 4 is due to internal methods.
Diffstat (limited to 'opcode.c')
| -rw-r--r-- | opcode.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -3,7 +3,7 @@ ** TecCGraf - PUC-Rio */ -char *rcs_opcode="$Id: opcode.c,v 3.92 1997/04/02 22:52:42 roberto Exp roberto $"; +char *rcs_opcode="$Id: opcode.c,v 3.93 1997/04/02 23:04:12 roberto Exp roberto $"; #include <setjmp.h> #include <stdio.h> @@ -412,9 +412,9 @@ static void getglobal (Word n) */ void lua_travstack (int (*fn)(TObject *)) { - TObject *o; - for (o = top-1; o >= stack; o--) - fn (o); + StkId i; + for (i = (top-1)-stack; i>=0; i--) + fn (stack+i); } @@ -671,7 +671,7 @@ void lua_setintmethod (int tag, char *event, lua_CFunction method) lua_pushcfunction (method); else lua_pushnil(); - do_unprotectedrun(luaI_setintmethod, 3, 0); + do_unprotectedrun(luaI_setintmethod, 3, 1); } void lua_seterrormethod (lua_CFunction method) |
