瀏覽代碼

error method *always* gets a string (otherwise it is not called at all)

Roberto Ierusalimschy 28 年之前
父節點
當前提交
807ba6301c
共有 1 個文件被更改,包括 2 次插入4 次删除
  1. 2 4
      ldo.c

+ 2 - 4
ldo.c

@@ -1,5 +1,5 @@
 /*
-** $Id: ldo.c,v 1.17 1997/12/18 18:32:39 roberto Exp roberto $
+** $Id: ldo.c,v 1.18 1997/12/22 20:57:18 roberto Exp roberto $
 ** Stack and Call structure of Lua
 ** See Copyright Notice in lua.h
 */
@@ -38,9 +38,7 @@
 
 static void stderrorim (void)
 {
-  lua_Object s = lua_getparam(1);
-  if (lua_isstring(s))
-    fprintf(stderr, "lua error: %s\n", lua_getstring(s));
+  fprintf(stderr, "lua error: %s\n", lua_getstring(lua_getparam(1)));
 }