diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1995-02-10 10:51:29 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1995-02-10 10:51:29 -0200 |
commit | 2043a0ca3032b809016dea0c50c90d8a3f4ee4dc (patch) | |
tree | 5c089b4302b1be557dabc93860d2f31d7c5516ea | |
parent | 0761c4c03603b437516d6dd0e83e250c55dcbe5e (diff) | |
download | lua-2043a0ca3032b809016dea0c50c90d8a3f4ee4dc.tar.gz lua-2043a0ca3032b809016dea0c50c90d8a3f4ee4dc.tar.bz2 lua-2043a0ca3032b809016dea0c50c90d8a3f4ee4dc.zip |
adjust checks if stack has enough space
-rw-r--r-- | opcode.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -3,7 +3,7 @@ | |||
3 | ** TecCGraf - PUC-Rio | 3 | ** TecCGraf - PUC-Rio |
4 | */ | 4 | */ |
5 | 5 | ||
6 | char *rcs_opcode="$Id: opcode.c,v 3.33 1995/02/02 20:05:37 roberto Exp roberto $"; | 6 | char *rcs_opcode="$Id: opcode.c,v 3.34 1995/02/06 19:35:09 roberto Exp roberto $"; |
7 | 7 | ||
8 | #include <setjmp.h> | 8 | #include <setjmp.h> |
9 | #include <stdlib.h> | 9 | #include <stdlib.h> |
@@ -184,7 +184,9 @@ static int lua_tostring (Object *obj) | |||
184 | */ | 184 | */ |
185 | static void adjust_top (StkId newtop) | 185 | static void adjust_top (StkId newtop) |
186 | { | 186 | { |
187 | Object *nt = stack+newtop; | 187 | Object *nt; |
188 | lua_checkstack(newtop); | ||
189 | nt = stack+newtop; | ||
188 | while (top < nt) tag(top++) = LUA_T_NIL; | 190 | while (top < nt) tag(top++) = LUA_T_NIL; |
189 | top = nt; /* top could be bigger than newtop */ | 191 | top = nt; /* top could be bigger than newtop */ |
190 | } | 192 | } |