Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot encode/decode a negative signed int64 #35

Open
mlove-au opened this issue Oct 23, 2017 · 0 comments
Open

Cannot encode/decode a negative signed int64 #35

mlove-au opened this issue Oct 23, 2017 · 0 comments

Comments

@mlove-au
Copy link

mlove-au commented Oct 23, 2017

Using the following schema

package integer64;
message TestSigned64
{
    optional int64 int64_ = 1;
}

the following code fails on the last assertion when run with lua5.1.5, but passes when run with luajit 2.04

local pb = require"pb"
local integer64 = require"protos.int64"

local msg = integer64.TestSigned64()
msg.int64_ = -1;
binary,err = msg:Serialize();
assert(not err)

local decoded = integer64.TestSigned64():Parse(binary)
assert(decoded:IsInitialized())
assert(decoded:HasField('int64_'))
assert(-1 == decoded.int64_)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant