Просмотр исходного кода

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

Wendal Chen 2 лет назад
Родитель
Сommit
b5aeb7071d
1 измененных файлов с 1 добавлено и 3 удалено
  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 {