瀏覽代碼

a few more instructions to testC (func2udata and getfield)

Roberto Ierusalimschy 16 年之前
父節點
當前提交
d119cf3035
共有 1 個文件被更改,包括 9 次插入1 次删除
  1. 9 1
      ltests.c

+ 9 - 1
ltests.c

@@ -1,5 +1,5 @@
 /*
-** $Id: ltests.c,v 2.72 2009/09/17 18:04:21 roberto Exp roberto $
+** $Id: ltests.c,v 2.73 2009/09/28 16:32:50 roberto Exp roberto $
 ** Internal Module for Debugging of the Lua Implementation
 ** See Copyright Notice in lua.h
 */
@@ -916,6 +916,10 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) {
     else if EQ("tocfunction") {
       lua_pushcfunction(L1, lua_tocfunction(L1, getindex));
     }
+    else if EQ("func2udata") {
+      lua_CFunction func = lua_tocfunction(L1, getindex);
+      lua_pushlightuserdata(L1, &func);
+    }
     else if EQ("return") {
       return getnum;
     }
@@ -970,6 +974,10 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) {
     else if EQ("gettable") {
       lua_gettable(L1, getindex);
     }
+    else if EQ("getfield") {
+      int t = getindex;
+      lua_getfield(L1, t, getname);
+    }
     else if EQ("rawgeti") {
       int t = getindex;
       lua_rawgeti(L1, t, getnum);