diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2017-01-23 11:43:57 -0800 |
---|---|---|
committer | Paul Yang <TeBoring@users.noreply.github.com> | 2017-01-23 11:43:57 -0800 |
commit | d9668797a2e6bb41f20bad47cd2494e5aa1a156b (patch) | |
tree | 169658de8b253c23262d7bbc1f347d2d237ca449 /ruby/ext/google/protobuf_c/encode_decode.c | |
parent | be83f46b67f1392a99511a36b687ce7db06efed8 (diff) | |
download | protobuf-d9668797a2e6bb41f20bad47cd2494e5aa1a156b.tar.gz protobuf-d9668797a2e6bb41f20bad47cd2494e5aa1a156b.tar.bz2 protobuf-d9668797a2e6bb41f20bad47cd2494e5aa1a156b.zip |
Update upb, fixes some bugs (including a hash table problem). (#2611)
* Update upb, fixes some bugs (including a hash table problem).
* Ruby: added a test for the previous hash table corruption.
Verified that this triggers the bug in the currently released
version.
* Ruby: bugfix for SEGV.
* Ruby: removed old code for dup'ing defs.
Diffstat (limited to 'ruby/ext/google/protobuf_c/encode_decode.c')
-rw-r--r-- | ruby/ext/google/protobuf_c/encode_decode.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ruby/ext/google/protobuf_c/encode_decode.c b/ruby/ext/google/protobuf_c/encode_decode.c index 08c72bcc..d86a1145 100644 --- a/ruby/ext/google/protobuf_c/encode_decode.c +++ b/ruby/ext/google/protobuf_c/encode_decode.c @@ -514,7 +514,7 @@ static void add_handlers_for_singular_field(upb_handlers *h, case UPB_TYPE_INT64: case UPB_TYPE_UINT64: case UPB_TYPE_DOUBLE: - upb_shim_set(h, f, offset, -1); + upb_msg_setscalarhandler(h, f, offset, -1); break; case UPB_TYPE_STRING: case UPB_TYPE_BYTES: { @@ -925,7 +925,7 @@ static void putmsg(VALUE msg, const Descriptor* desc, static upb_selector_t getsel(const upb_fielddef *f, upb_handlertype_t type) { upb_selector_t ret; bool ok = upb_handlers_getselector(f, type, &ret); - UPB_ASSERT_VAR(ok, ok); + UPB_ASSERT(ok); return ret; } @@ -939,9 +939,9 @@ static void putstr(VALUE str, const upb_fielddef *f, upb_sink *sink) { // We should be guaranteed that the string has the correct encoding because // we ensured this at assignment time and then froze the string. if (upb_fielddef_type(f) == UPB_TYPE_STRING) { - assert(rb_enc_from_index(ENCODING_GET(value)) == kRubyStringUtf8Encoding); + assert(rb_enc_from_index(ENCODING_GET(str)) == kRubyStringUtf8Encoding); } else { - assert(rb_enc_from_index(ENCODING_GET(value)) == kRubyString8bitEncoding); + assert(rb_enc_from_index(ENCODING_GET(str)) == kRubyString8bitEncoding); } upb_sink_startstr(sink, getsel(f, UPB_HANDLER_STARTSTR), RSTRING_LEN(str), |