From 6699279d538422b596ccfceef0bcc3d87561e0d0 Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Wed, 5 Apr 2017 14:16:17 +0800 Subject: [PATCH] update sproto --- lualib-src/sproto/lsproto.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lualib-src/sproto/lsproto.c b/lualib-src/sproto/lsproto.c index 827ba96a..11b1a67d 100644 --- a/lualib-src/sproto/lsproto.c +++ b/lualib-src/sproto/lsproto.c @@ -341,7 +341,8 @@ decode(const struct sproto_arg *args) { case SPROTO_TINTEGER: { // notice: in lua 5.2, 52bit integer support (not 64) if (args->extra) { - lua_Integer v = *(uint64_t*)args->value; + // lua_Integer is 32bit in small lua. + uint64_t v = *(uint64_t*)args->value; lua_Number vn = (lua_Number)v; vn /= args->extra; lua_pushnumber(L, vn);