Added descriptive comment about descriptor nesting.

pull/13171/head
Josh Haberman 9 years ago
parent bb872be0c0
commit c387d372ee
  1. 3
      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) {

Loading…
Cancel
Save