Explorar o código

fix: rotable读取到不存在的名称时有可能挂

Wendal Chen %!s(int64=4) %!d(string=hai) anos
pai
achega
a1ac00342a
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      lua/src/rotable.c

+ 1 - 1
lua/src/rotable.c

@@ -102,7 +102,7 @@ static int rotable_func_index( lua_State* L ) {
   }
   else {
     // 看看第一个方法是不是__index, 如果是的话, 调用之
-    if (p2->name != NULL && !strcmp("__index", p->name)) {
+    if (p2->name != NULL && !strcmp("__index", p2->name)) {
       lua_pushcfunction(L, p2->func);
       lua_pushvalue(L, 2);
       lua_call(L, 1, 1);