aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1995-02-10 10:51:29 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1995-02-10 10:51:29 -0200
commit2043a0ca3032b809016dea0c50c90d8a3f4ee4dc (patch)
tree5c089b4302b1be557dabc93860d2f31d7c5516ea
parent0761c4c03603b437516d6dd0e83e250c55dcbe5e (diff)
downloadlua-2043a0ca3032b809016dea0c50c90d8a3f4ee4dc.tar.gz
lua-2043a0ca3032b809016dea0c50c90d8a3f4ee4dc.tar.bz2
lua-2043a0ca3032b809016dea0c50c90d8a3f4ee4dc.zip
adjust checks if stack has enough space
-rw-r--r--opcode.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/opcode.c b/opcode.c
index 7d5fd838..f46f6a88 100644
--- a/opcode.c
+++ b/opcode.c
@@ -3,7 +3,7 @@
3** TecCGraf - PUC-Rio 3** TecCGraf - PUC-Rio
4*/ 4*/
5 5
6char *rcs_opcode="$Id: opcode.c,v 3.33 1995/02/02 20:05:37 roberto Exp roberto $"; 6char *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*/
185static void adjust_top (StkId newtop) 185static 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}