~bigbes/tarantool-protobuf: 0c13fd73

wire: truncate varints to 32 bits in int32/uint32/sint32/enum decode

decode_int32/uint32/sint32 returned full uint64 values when the wire input
carried bits above bit 31, corrupting re-encode on 51 conformance tests that
exercise overlong or over-range varints. Per the proto3 spec the decoder
must keep only the low 32 bits (and sign-extend for signed types).

Adds wire.varint_to_int32 / varint_to_uint32 and routes every enum-varint
decode site through them: wire.lua typed decoders, codec.lua (5 enum
sites), lazy.lua (3 sites), and the generated code via inline.go (3 sites).

Drops 51 entries from test/conformance/known_failures.txt.

Eugene Blikh <bigbes@gmail.com> — 2026-05-15 21:13:28 UTC

Commit 0c13fd735d0b7e3218d2b9d1f64c074e01c14234view raw patch

Parent(s): d855bcfd

8 changed file(s)

FileStatus+
cmd/protoc-gen-tarantool/internal/gen/inline.go M +4 -4
examples/expected/full/conformance/conformance_pb.lua M +2 -2
examples/expected/full/hello/hello_pb.lua M +1 -1
examples/expected/full/protobuf_test_messages/proto3/test_messages_proto3_pb.lua M +16 -16
runtime/pb/codec.lua M +10 -8
runtime/pb/lazy.lua M +3 -3
runtime/pb/wire.lua M +17 -5
test/conformance/known_failures.txt M -51