"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.
This commit is contained in:
Roberto Ierusalimschy 1997-04-03 15:27:06 -03:00
parent c1746340c3
commit 1ea6e8064c
1 changed files with 5 additions and 5 deletions

View File

@ -3,7 +3,7 @@
** TecCGraf - PUC-Rio ** 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 <setjmp.h>
#include <stdio.h> #include <stdio.h>
@ -412,9 +412,9 @@ static void getglobal (Word n)
*/ */
void lua_travstack (int (*fn)(TObject *)) void lua_travstack (int (*fn)(TObject *))
{ {
TObject *o; StkId i;
for (o = top-1; o >= stack; o--) for (i = (top-1)-stack; i>=0; i--)
fn (o); fn (stack+i);
} }
@ -671,7 +671,7 @@ void lua_setintmethod (int tag, char *event, lua_CFunction method)
lua_pushcfunction (method); lua_pushcfunction (method);
else else
lua_pushnil(); lua_pushnil();
do_unprotectedrun(luaI_setintmethod, 3, 0); do_unprotectedrun(luaI_setintmethod, 3, 1);
} }
void lua_seterrormethod (lua_CFunction method) void lua_seterrormethod (lua_CFunction method)