Roberto Ierusalimschy 20 年之前
父節點
當前提交
ee1edd5734
共有 2 個文件被更改,包括 5 次插入6 次删除
  1. 2 2
      lapi.c
  2. 3 4
      lvm.c

+ 2 - 2
lapi.c

@@ -1,5 +1,5 @@
 /*
-** $Id: lapi.c,v 2.42 2005/05/31 14:25:18 roberto Exp roberto $
+** $Id: lapi.c,v 2.43 2005/05/31 14:34:02 roberto Exp roberto $
 ** Lua API
 ** See Copyright Notice in lua.h
 */
@@ -985,7 +985,7 @@ LUA_API void lua_concat (lua_State *L, int n) {
 
 
 LUA_API lua_Alloc lua_getallocf (lua_State *L, void **ud) {
-  *ud = G(L)->ud;
+  if (ud) *ud = G(L)->ud;
   return G(L)->frealloc;
 }
 

+ 3 - 4
lvm.c

@@ -1,5 +1,5 @@
 /*
-** $Id: lvm.c,v 2.46 2005/05/31 14:25:18 roberto Exp roberto $
+** $Id: lvm.c,v 2.47 2005/06/13 14:15:22 roberto Exp roberto $
 ** Lua virtual machine
 ** See Copyright Notice in lua.h
 */
@@ -311,8 +311,8 @@ void luaV_concat (lua_State *L, int total, int last) {
 }
 
 
-static StkId Arith (lua_State *L, StkId ra, const TValue *rb,
-                    const TValue *rc, TMS op) {
+static void Arith (lua_State *L, StkId ra, const TValue *rb,
+                   const TValue *rc, TMS op) {
   TValue tempb, tempc;
   const TValue *b, *c;
   if ((b = luaV_tonumber(rb, &tempb)) != NULL &&
@@ -330,7 +330,6 @@ static StkId Arith (lua_State *L, StkId ra, const TValue *rb,
   }
   else if (!call_binTM(L, rb, rc, ra, op))
     luaG_aritherror(L, rb, rc);
-  return L->base;
 }