From 0b7904e18cad70e17a2dbed5f1362ccdc62fd385 Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Tue, 19 Sep 2017 14:23:36 -0700 Subject: 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. --- upb/def.c | 1 + 1 file changed, 1 insertion(+) (limited to 'upb/def.c') 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)) { -- cgit v1.2.3