aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1994-11-17 19:11:37 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1994-11-17 19:11:37 -0200
commitaa4cd37adfdeb84b8137d3fccdb28a49a3b6d9e5 (patch)
treee6ae5845f5c894b020831bcb9fe3340a4b5ab1c4
parenta84aa11f71be730d554aa208d2b40ad28f2c9e05 (diff)
downloadlua-aa4cd37adfdeb84b8137d3fccdb28a49a3b6d9e5.tar.gz
lua-aa4cd37adfdeb84b8137d3fccdb28a49a3b6d9e5.tar.bz2
lua-aa4cd37adfdeb84b8137d3fccdb28a49a3b6d9e5.zip
small bug corrected
-rw-r--r--lua.stx14
1 files changed, 7 insertions, 7 deletions
diff --git a/lua.stx b/lua.stx
index a2e75b34..fc57aed5 100644
--- a/lua.stx
+++ b/lua.stx
@@ -1,6 +1,6 @@
1%{ 1%{
2 2
3char *rcs_luastx = "$Id: lua.stx,v 3.7 1994/11/17 18:59:06 roberto Exp roberto $"; 3char *rcs_luastx = "$Id: lua.stx,v 3.8 1994/11/17 19:09:46 roberto Exp roberto $";
4 4
5#include <stdio.h> 5#include <stdio.h>
6#include <stdlib.h> 6#include <stdlib.h>
@@ -237,9 +237,6 @@ function : FUNCTION NAME
237 Word func = luaI_findsymbol($2); 237 Word func = luaI_findsymbol($2);
238 s_tag(func) = LUA_T_FUNCTION; 238 s_tag(func) = LUA_T_FUNCTION;
239 s_bvalue(func) = $4; 239 s_bvalue(func) = $4;
240#if LISTING
241 PrintCode(funcCode,funcCode+pc);
242#endif
243 } 240 }
244 ; 241 ;
245 242
@@ -251,9 +248,6 @@ method : FUNCTION NAME ':' NAME
251 } 248 }
252 body 249 body
253 { 250 {
254#if LISTING
255 PrintCode(funcCode,funcCode+pc);
256#endif
257 /* assign function to table field */ 251 /* assign function to table field */
258 pc=maincode; basepc=*initcode; maxcurr=maxmain; 252 pc=maincode; basepc=*initcode; maxcurr=maxmain;
259 nlocalvar=0; 253 nlocalvar=0;
@@ -273,6 +267,9 @@ body : '(' parlist ')' block END
273 $$ = newvector(pc, Byte); 267 $$ = newvector(pc, Byte);
274 memcpy($$, basepc, pc*sizeof(Byte)); 268 memcpy($$, basepc, pc*sizeof(Byte));
275 funcCode = basepc; maxcode=maxcurr; 269 funcCode = basepc; maxcode=maxcurr;
270#if LISTING
271 PrintCode(funcCode,funcCode+pc);
272#endif
276 } 273 }
277 ; 274 ;
278 275
@@ -692,7 +689,10 @@ static void codeIf (Long thenAdd, Long elseAdd)
692{ 689{
693 Long elseinit = elseAdd+sizeof(Word)+1; 690 Long elseinit = elseAdd+sizeof(Word)+1;
694 if (pc == elseinit) /* no else */ 691 if (pc == elseinit) /* no else */
692 {
695 pc -= sizeof(Word)+1; 693 pc -= sizeof(Word)+1;
694 elseinit = pc;
695 }
696 else 696 else
697 { 697 {
698 basepc[elseAdd] = JMP; 698 basepc[elseAdd] = JMP;