summaryrefslogtreecommitdiff
path: root/upb/def.c
diff options
context:
space:
mode:
authorBo Yang <teboring@google.com>2017-09-19 14:23:36 -0700
committerBo Yang <teboring@google.com>2017-09-19 14:23:36 -0700
commit0b7904e18cad70e17a2dbed5f1362ccdc62fd385 (patch)
treee94665631c7437d1bebb62b9a45f0c1be1f21d81 /upb/def.c
parentae30b4a816a57a8101ce187245edc3050d515c06 (diff)
Reserve unknown fields in upb
1. For decoding, an unknownfields will be lazily created on message, which contains bytes of unknown fields. 2. For encoding, if the unknownfields is present on message, all bytes contained in it will be serialized.
Diffstat (limited to 'upb/def.c')
-rw-r--r--upb/def.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/upb/def.c b/upb/def.c
index ceaced2..60bbb84 100644
--- a/upb/def.c
+++ b/upb/def.c
@@ -327,6 +327,7 @@ static bool assign_msg_indices(upb_msgdef *m, upb_status *s) {
v = upb_value_bool(true);
upb_inttable_insert(&t, UPB_STARTMSG_SELECTOR, v);
upb_inttable_insert(&t, UPB_ENDMSG_SELECTOR, v);
+ upb_inttable_insert(&t, UPB_UNKNOWN_SELECTOR, v);
for(upb_msg_field_begin(&j, m);
!upb_msg_field_done(&j);
upb_msg_field_next(&j)) {
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback