Roberto Ierusalimschy 19 years ago
parent
commit
3c8865cf66
2 changed files with 5 additions and 3 deletions
  1. 2 1
      lauxlib.c
  2. 3 2
      lcode.c

+ 2 - 1
lauxlib.c

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: lauxlib.c,v 1.160 2006/06/22 16:12:59 roberto Exp roberto $
+** $Id: lauxlib.c,v 1.161 2006/09/18 14:03:18 roberto Exp roberto $
 ** Auxiliary functions for building Lua libraries
 ** Auxiliary functions for building Lua libraries
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -641,6 +641,7 @@ static int panic (lua_State *L) {
   (void)L;  /* to avoid warnings */
   (void)L;  /* to avoid warnings */
   fprintf(stderr, "PANIC: unprotected error in call to Lua API (%s)\n",
   fprintf(stderr, "PANIC: unprotected error in call to Lua API (%s)\n",
                    lua_tostring(L, -1));
                    lua_tostring(L, -1));
+  exit(EXIT_FAILURE);  /* do not return to Lua */
   return 0;
   return 0;
 }
 }
 
 

+ 3 - 2
lcode.c

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: lcode.c,v 2.28 2006/09/14 12:59:06 roberto Exp roberto $
+** $Id: lcode.c,v 2.29 2006/09/14 18:42:28 roberto Exp roberto $
 ** Code generator for Lua
 ** Code generator for Lua
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -37,7 +37,8 @@ void luaK_nil (FuncState *fs, int from, int n) {
   if (fs->pc > fs->lasttarget) {  /* no jumps to current position? */
   if (fs->pc > fs->lasttarget) {  /* no jumps to current position? */
     if (fs->pc == 0)  /* function start? */
     if (fs->pc == 0)  /* function start? */
       return;  /* positions are already clean */
       return;  /* positions are already clean */
-    if (GET_OPCODE(*(previous = &fs->f->code[fs->pc-1])) == OP_LOADNIL) {
+    previous = &fs->f->code[fs->pc-1];
+    if (GET_OPCODE(*previous) == OP_LOADNIL) {
       int pfrom = GETARG_A(*previous);
       int pfrom = GETARG_A(*previous);
       int pto = GETARG_B(*previous);
       int pto = GETARG_B(*previous);
       if (pfrom <= from && from <= pto+1) {  /* can connect both? */
       if (pfrom <= from && from <= pto+1) {  /* can connect both? */