From 0168f28daf05a07f4d53b045e1a2a398fcd33c8f Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Mon, 6 Feb 2017 11:34:50 -0800 Subject: [PATCH] Bug fix: When encoding, negative int32 values should be padded to int64 in order to be wire compatible --- upb/pb/encoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upb/pb/encoder.c b/upb/pb/encoder.c index 780425db8a..b457867020 100644 --- a/upb/pb/encoder.c +++ b/upb/pb/encoder.c @@ -411,7 +411,7 @@ static size_t encode_strbuf(void *c, const void *hd, const char *buf, T(double, double, dbl2uint64, encode_fixed64) T(float, float, flt2uint32, encode_fixed32) T(int64, int64_t, uint64_t, encode_varint) -T(int32, int32_t, uint32_t, encode_varint) +T(int32, int32_t, int64_t, encode_varint) T(fixed64, uint64_t, uint64_t, encode_fixed64) T(fixed32, uint32_t, uint32_t, encode_fixed32) T(bool, bool, bool, encode_varint)