summaryrefslogtreecommitdiff
path: root/lib/lua
diff options
context:
space:
mode:
authorJeffrey Han <jeffreyhan@fb.com>2020-02-20 14:18:23 -0800
committerJens Geyer <jensg@apache.org>2020-02-21 21:08:19 +0100
commit7b712f42d7bc03610511abd397845983deafa258 (patch)
tree3ee0c4bcd77ce5e184e5478fc42af772e92da755 /lib/lua
parent222362cc70d66b5f8bb6422622fcf384407b54c8 (diff)
downloadthrift-7b712f42d7bc03610511abd397845983deafa258.tar.gz
THRIFT-5106: Fix various Lua library and compiler issues
Client: lua Patch: Jeffrey Han This closes #2014
Diffstat (limited to 'lib/lua')
-rw-r--r--lib/lua/TCompactProtocol.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/lua/TCompactProtocol.lua b/lib/lua/TCompactProtocol.lua
index 7b75967a9..8e7db8e66 100644
--- a/lib/lua/TCompactProtocol.lua
+++ b/lib/lua/TCompactProtocol.lua
@@ -314,10 +314,10 @@ end
function TCompactProtocol:readMapBegin()
local size = self:readVarint32()
- if size < 0 then
- return nil,nil,nil
+ local kvtype = 0
+ if size > 0 then
+ kvtype = self:readSignByte()
end
- local kvtype = self:readSignByte()
local ktype = self:getTType(libluabitwise.shiftr(kvtype, 4))
local vtype = self:getTType(kvtype)
return ktype, vtype, size
@@ -426,7 +426,7 @@ function TCompactProtocol:readVarint64()
local data = result(0)
local shiftl = 0
while true do
- b = self:readByte()
+ b = self:readSignByte()
endFlag, data = libluabpack.fromVarint64(b, shiftl, data)
shiftl = shiftl + 7
if endFlag == 0 then