aboutsummaryrefslogtreecommitdiff
path: root/ruby/ext/google/protobuf_c/upb.h
diff options
context:
space:
mode:
authorJosh Haberman <jhaberman@gmail.com>2015-08-03 15:51:31 -0700
committerJosh Haberman <jhaberman@gmail.com>2015-08-12 18:50:15 -0700
commit5bdf4a42713424cbe3cb45a6aef281670c6cdf40 (patch)
treecaadd1d5204cd2e57111f4205c5253881eefe4b6 /ruby/ext/google/protobuf_c/upb.h
parent38a56ee4b19d72c2e9d81a08b018704d1addf561 (diff)
downloadprotobuf-5bdf4a42713424cbe3cb45a6aef281670c6cdf40.tar.gz
protobuf-5bdf4a42713424cbe3cb45a6aef281670c6cdf40.tar.bz2
protobuf-5bdf4a42713424cbe3cb45a6aef281670c6cdf40.zip
Fixed several Ruby conformance test cases through upb update.
Change-Id: Ief77de7134e05e07b1a7e3970d49880c2d5e6fe9
Diffstat (limited to 'ruby/ext/google/protobuf_c/upb.h')
-rw-r--r--ruby/ext/google/protobuf_c/upb.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/ruby/ext/google/protobuf_c/upb.h b/ruby/ext/google/protobuf_c/upb.h
index b31f5c08..078e2a28 100644
--- a/ruby/ext/google/protobuf_c/upb.h
+++ b/ruby/ext/google/protobuf_c/upb.h
@@ -5635,7 +5635,7 @@ UPB_INLINE bool upb_bufsrc_putbuf(const char *buf, size_t len,
upb_bufhandle_setbuf(&handle, buf, 0);
ret = upb_bytessink_start(sink, len, &subc);
if (ret && len != 0) {
- ret = (upb_bytessink_putbuf(sink, subc, buf, len, &handle) == len);
+ ret = (upb_bytessink_putbuf(sink, subc, buf, len, &handle) >= len);
}
if (ret) {
ret = upb_bytessink_end(sink);
@@ -7123,7 +7123,7 @@ class upb::pb::DecoderMethod {
* constructed. This hint may be an overestimate for some build configurations.
* But if the decoder library is upgraded without recompiling the application,
* it may be an underestimate. */
-#define UPB_PB_DECODER_SIZE 4400
+#define UPB_PB_DECODER_SIZE 4408
#ifdef __cplusplus
@@ -7548,6 +7548,12 @@ struct upb_pbdecoder {
char residual[12];
char *residual_end;
+ /* Bytes of data that should be discarded from the input beore we start
+ * parsing again. We set this when we internally determine that we can
+ * safely skip the next N bytes, but this region extends past the current
+ * user buffer. */
+ size_t skip;
+
/* Stores the user buffer passed to our decode function. */
const char *buf_param;
size_t size_param;
@@ -7590,6 +7596,7 @@ void upb_pbdecoder_seterr(upb_pbdecoder *d, const char *msg);
/* Error messages that are shared between the bytecode and JIT decoders. */
extern const char *kPbDecoderStackOverflow;
+extern const char *kPbDecoderSubmessageTooLong;
/* Access to decoderplan members needed by the decoder. */
const char *upb_pbdecoder_getopname(unsigned int op);