small optimization in opcodes for "and" and "or"
diff --git a/lua.stx b/lua.stx
index 45dbb7e..7c1b748 100644
--- a/lua.stx
+++ b/lua.stx
@@ -1,6 +1,6 @@
 %{
 
-char *rcs_luastx = "$Id: lua.stx,v 3.49 1997/07/30 22:00:50 roberto Exp roberto $";
+char *rcs_luastx = "$Id: lua.stx,v 3.50 1997/07/31 20:46:59 roberto Exp roberto $";
 
 #include <stdlib.h>
 
@@ -660,12 +660,12 @@
      |	NIL		{code_byte(PUSHNIL); $$ = 0; }
      |  functioncall    { $$ = $1; }
      |	NOT expr1	{ code_byte(NOTOP);  $$ = 0;}
-     |	expr1 AND PrepJump {code_byte(POP); } expr1
+     |	expr1 AND PrepJump expr1
      { 
        code_shortcircuit($3, ONFJMP);
        $$ = 0;
      }
-     |	expr1 OR PrepJump {code_byte(POP); } expr1	
+     |	expr1 OR PrepJump expr1	
      { 
        code_shortcircuit($3, ONTJMP);
        $$ = 0;
diff --git a/opcode.c b/opcode.c
index a5ade2c..e569d28 100644
--- a/opcode.c
+++ b/opcode.c
@@ -3,7 +3,7 @@
 ** TecCGraf - PUC-Rio
 */
 
-char *rcs_opcode="$Id: opcode.c,v 4.20 1997/07/30 22:00:50 roberto Exp roberto $";
+char *rcs_opcode="$Id: opcode.c,v 4.21 1997/07/31 19:37:37 roberto Exp roberto $";
 
 #include <setjmp.h>
 #include <stdio.h>
@@ -1384,6 +1384,7 @@
     Word w;
     get_word(w,pc);
     if (ttype(top-1) != LUA_T_NIL) pc += w;
+    else top--;
    }
    break;
 
@@ -1392,6 +1393,7 @@
     Word w;
     get_word(w,pc);
     if (ttype(top-1) == LUA_T_NIL) pc += w;
+    else top--;
    }
    break;
 
@@ -1429,8 +1431,6 @@
    }
    break;
 
-   case POP: --top; break;
-
    case CALLFUNC:
    {
      int nParams = *(pc++);
diff --git a/opcode.h b/opcode.h
index 386cec3..406ff97 100644
--- a/opcode.h
+++ b/opcode.h
@@ -1,6 +1,6 @@
 /*
 ** TeCGraf - PUC-Rio
-** $Id: opcode.h,v 3.36 1997/07/29 20:38:06 roberto Exp roberto $
+** $Id: opcode.h,v 3.37 1997/07/30 22:00:50 roberto Exp roberto $
 */
 
 #ifndef opcode_h
@@ -60,7 +60,7 @@
 PUSHLOCAL,/*	b	-		LOC[b]  */
 PUSHGLOBAL,/*	w	-		VAR[w]  */
 PUSHINDEXED,/*		i t		t[i]  */
-PUSHSELF,/*	w	t		t t[STR[w]]  */
+PUSHSELF,/*	w	t		t t[CNST[w]]  */
 STORELOCAL0,/*		x		-		LOC[0]=x  */
 STORELOCAL1,/*		x		-		LOC[1]=x  */
 STORELOCAL2,/*		x		-		LOC[2]=x  */
@@ -78,7 +78,7 @@
 STORELIST0,/*	b	v_b...v_1 t	-		t[i]=v_i  */
 STORELIST,/*	b c	v_b...v_1 t	-		t[i+c*FPF]=v_i  */
 STORERECORD,/*	b
-		w_b...w_1 v_b...v_1 t	-		t[STR[w_i]]=v_i  */
+		w_b...w_1 v_b...v_1 t	-		t[CNST[w_i]]=v_i  */
 ADJUST0,/*		-		-		TOP=BASE  */
 ADJUST,/*	b	-		-		TOP=BASE+b  */
 CREATEARRAY,/*	w	-		newarray(size = w)  */
@@ -95,21 +95,20 @@
 CONCOP,/*		y x		x..y  */
 MINUSOP,/*		x		-x  */
 NOTOP,/*		x		(x==nil)? 1 : nil  */
-ONTJMP,/*	w	x		-		(x!=nil)? PC+=w  */
-ONFJMP,/*	w	x		-		(x==nil)? PC+=w  */
+ONTJMP,/*	w	x		(x!=nil)? x : -	(x!=nil)? PC+=w  */
+ONFJMP,/*	w	x		(x==nil)? x : -	(x==nil)? PC+=w  */
 JMP,/*		w	-		-		PC+=w  */
 UPJMP,/*	w	-		-		PC-=w  */
 IFFJMP,/*	w	x		-		(x==nil)? PC+=w  */
 IFFUPJMP,/*	w	x		-		(x==nil)? PC-=w  */
-POP,/*			x		-  */
 CALLFUNC,/*	b c	v_b...v_1 f	r_c...r_1	f(v1,...,v_b)  */
 RETCODE0,
 RETCODE,/*	b	-		-  */
 SETLINE,/*	w	-		-		LINE=w  */
 VARARGS,/*	b	v_b...v_1	{v_1...v_b;n=b}  */
 STOREMAP,/*	b	v_b k_b ...v_1 k_1 t	-	t[k_i]=v_i  */
-PUSHCONSTANTB,/*b	-		const[b] */
-PUSHCONSTANT,/* w	-		const[w] */
+PUSHCONSTANTB,/*b	-		CNST[b] */
+PUSHCONSTANT,/* w	-		CNST[w] */
 ENDCODE = 127
 } OpCode;
 
diff --git a/undump.c b/undump.c
index 0d1ca1a..80f131d 100644
--- a/undump.c
+++ b/undump.c
@@ -3,7 +3,7 @@
 ** load bytecodes from files
 */
 
-char* rcs_undump="$Id: undump.c,v 1.24 1997/06/17 18:19:17 roberto Exp roberto $";
+char* rcs_undump="$Id: undump.c,v 1.25 1997/07/29 19:44:02 roberto Exp roberto $";
 
 #include <stdio.h>
 #include <string.h>
@@ -67,7 +67,6 @@
 	case CONCOP:
 	case MINUSOP:
 	case NOTOP:
-	case POP:
 	case RETCODE0:
 		p++;
 		break;
@@ -86,9 +85,6 @@
 	case CALLFUNC:
 		p+=3;
 		break;
-	case PUSHFUNCTION:
-		p+=5;			/* TODO: use sizeof(TFunc*) or old? */
-		break;
 	case PUSHWORD:
 	case PUSHSELF:
 	case CREATEARRAY:
@@ -99,7 +95,6 @@
 	case IFFJMP:
 	case IFFUPJMP:
 	case SETLINE:
-	case PUSHSTRING:
 	case PUSHGLOBAL:
 	case STOREGLOBAL:
 	{
@@ -108,14 +103,6 @@
 		p+=3;
 		break;
 	}
-	case PUSHFLOAT:			/* assumes sizeof(float)==4 */
-	{
-		Byte t;
-		t=p[1]; p[1]=p[4]; p[4]=t;
-		t=p[2]; p[2]=p[3]; p[3]=t;
-		p+=5;
-		break;
-	}
 	case STORERECORD:
 	{
 		int n=*++p;
@@ -226,7 +213,7 @@
   {
    int i=LoadWord(Z);
    char* s=LoadString(Z);
-   int v=luaI_findconstantbyname(s);
+   int v; /*=luaI_findconstantbyname(s); ??????? */
    Unthread(tf->code,i,v);
   }
   else
@@ -324,7 +311,7 @@
  while ((m=luaI_undump1(Z)))
  {
   int status=luaI_dorun(m);
-  luaI_freefunc(m);
+/*  luaI_freefunc(m); ???*/
   if (status!=0) return status;
  }
  return 0;