diff --git a/tests/conformance_upb_failures.txt b/tests/conformance_upb_failures.txt index 7ff834aece..33c013d927 100644 --- a/tests/conformance_upb_failures.txt +++ b/tests/conformance_upb_failures.txt @@ -12,10 +12,4 @@ Required.ProtobufInput.RepeatedScalarSelectsLast.FIXED32.ProtobufOutput Required.ProtobufInput.RepeatedScalarSelectsLast.FIXED64.ProtobufOutput Required.ProtobufInput.RepeatedScalarSelectsLast.UINT64.ProtobufOutput Required.ProtobufInput.ValidDataRepeated.BOOL.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.INT32.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.INT64.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.SINT32.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.SINT64.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.UINT32.ProtobufOutput -Required.ProtobufInput.ValidDataRepeated.UINT64.ProtobufOutput Required.ProtobufInput.ValidDataScalar.BOOL.ProtobufOutput diff --git a/upb/encode.c b/upb/encode.c index ced971ef81..8a220ef6e2 100644 --- a/upb/encode.c +++ b/upb/encode.c @@ -167,12 +167,12 @@ static bool upb_encode_array(upb_encstate *e, const char *field_mem, #define VARINT_CASE(ctype, encode) { \ ctype *start = arr->data; \ ctype *ptr = start + arr->len; \ - char *buf_ptr = e->ptr; \ + size_t pre_len = e->limit - e->ptr; \ do { \ ptr--; \ CHK(upb_put_varint(e, encode)); \ } while (ptr != start); \ - CHK(upb_put_varint(e, buf_ptr - e->ptr)); \ + CHK(upb_put_varint(e, e->limit - e->ptr - pre_len)); \ } \ break; \ do { ; } while(0)