Explorar o código

fix: protobuf库无法正确解码64bit的数据 https://gitee.com/openLuat/LuatOS/issues/I6KT04

Wendal Chen %!s(int64=2) %!d(string=hai) anos
pai
achega
b5aeb7071d
Modificáronse 1 ficheiros con 1 adicións e 3 borrados
  1. 1 3
      components/serialization/protobuf/luat_lib_protobuf.c

+ 1 - 3
components/serialization/protobuf/luat_lib_protobuf.c

@@ -390,10 +390,8 @@ static void lpb_pushinteger(lua_State *L, int64_t n, int mode) {
         if (neg) *--p = '-';
         *--p = '#';
         lua_pushstring(L, p);
-    } else if (LUA_VERSION_NUM >= 503 && (n >> 32) == 0) // 原版是判断lua_Integer是否8字节
+    } else // 原版是判断lua_Integer是否8字节
         lua_pushinteger(L, (lua_Integer)n);
-    else
-        lua_pushnumber(L, (lua_Number)n);
 }
 
 typedef union lpb_Value {