Skip to content

Cannot encode/decode a negative signed int64 #35

Open
@mlove-au

Description

@mlove-au

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_)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions