mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-28 08:28:05 +00:00
Fixed LuaJIT when not compiled with COMPAT mode (#6605)
LuaJIT as installed by apt doesn't include the COMPAT mode for using Lua5.2 features. So this change just makes the flatbuffer code use a common implementation.
This commit is contained in:
@@ -19,7 +19,13 @@ test_dir="$(pwd)"
|
||||
|
||||
${test_dir}/../flatc --lua -I include_test monster_test.fbs
|
||||
|
||||
echo "Run with LuaJIT:"
|
||||
luajit luatest.lua
|
||||
echo "Run with Lua 5.3:"
|
||||
lua5.3 luatest.lua
|
||||
declare -a versions=(luajit lua5.3)
|
||||
|
||||
for i in "${versions[@]}"
|
||||
do
|
||||
if command -v $i &> /dev/null
|
||||
then
|
||||
echo "[$i]"
|
||||
$i luatest.lua
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package.path = string.format("../lua/?.lua;./?.lua;%s",package.path)
|
||||
local compat = require("flatbuffers.compat")
|
||||
|
||||
local performBenchmarkTests = false
|
||||
|
||||
@@ -20,7 +21,7 @@ local function checkReadBuffer(buf, offset, sizePrefix)
|
||||
|
||||
if sizePrefix then
|
||||
local size = flatbuffers.N.Int32:Unpack(buf, offset)
|
||||
assert(size == #buf - offset - 4)
|
||||
assert(size == buf.size - offset - 4)
|
||||
offset = offset + flatbuffers.N.Int32.bytewidth
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user