diff options
author | Josh Haberman <jhaberman@gmail.com> | 2016-09-09 14:54:15 -0700 |
---|---|---|
committer | Josh Haberman <jhaberman@gmail.com> | 2016-09-09 14:54:15 -0700 |
commit | c387d372ee42d338ca03d91112370c532c6bc574 (patch) | |
tree | 9575493de4ffadb15ea2384ded0c069d968f7196 /upb | |
parent | bb872be0c0e40a25b7529bce98643688a85b612e (diff) |
Added descriptive comment about descriptor nesting.
Diffstat (limited to 'upb')
-rw-r--r-- | upb/descriptor/reader.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/upb/descriptor/reader.c b/upb/descriptor/reader.c index 4164bc7..b515840 100644 --- a/upb/descriptor/reader.c +++ b/upb/descriptor/reader.c @@ -165,6 +165,9 @@ static upb_oneofdef *upb_descreader_getoneof(upb_descreader *r, upb_value val; upb_descreader_frame *f = &r->stack[r->stack_len-1]; + /* DescriptorProto messages can be nested, so we will see the nested messages + * between when we see the FieldDescriptorProto and the OneofDescriptorProto. + * We need to preserve the oneofs in between these two things. */ index += f->oneof_start; while (upb_inttable_count(&r->oneofs) <= index) { |