From 413ccaf6b9e44efbee7ddcd7c1abc6c246e10191 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Thu, 23 Jul 2009 16:15:18 -0700 Subject: Re-enable checks for set_flags now that upbc emits them. --- src/upb_context.c | 7 ++----- src/upb_msg.c | 5 ++--- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/upb_context.c b/src/upb_context.c index 657870f..00b62cc 100644 --- a/src/upb_context.c +++ b/src/upb_context.c @@ -28,7 +28,6 @@ bool upb_context_init(struct upb_context *c) upb_strtable_init(&c->psymtab, 16, sizeof(struct upb_symtab_entry)); /* Add all the types in descriptor.proto so we can parse descriptors. */ if(!addfd(&c->psymtab, &c->symtab, upb_file_descriptor_set->file->elements[0], false)) { - //if(!addfd(&c->psymtab, &c->symtab, &google_protobuf_filedescriptor, false)) { assert(false); return false; /* Indicates that upb is buggy or corrupt. */ } @@ -149,8 +148,7 @@ static bool insert_enum(struct upb_strtable *t, google_protobuf_EnumDescriptorProto *ed, struct upb_string *base) { - // TODO: re-enable when compiler sets this flag - //if(!ed->set_flags.has.name) return false; + if(!ed->set_flags.has.name) return false; /* We own this and must free it on destruct. */ struct upb_string fqname = join(base, ed->name); @@ -175,8 +173,7 @@ static bool insert_message(struct upb_strtable *t, google_protobuf_DescriptorProto *d, struct upb_string *base, bool sort) { - /* TODO: re-enable when compiler sets this flag. */ - //if(!d->set_flags.has.name) return false; + if(!d->set_flags.has.name) return false; /* We own this and must free it on destruct. */ struct upb_string fqname = join(base, d->name); diff --git a/src/upb_msg.c b/src/upb_msg.c index bfe8436..f589d3d 100644 --- a/src/upb_msg.c +++ b/src/upb_msg.c @@ -42,9 +42,8 @@ void upb_msg_sortfds(google_protobuf_FieldDescriptorProto **fds, size_t num) bool upb_msg_init(struct upb_msg *m, google_protobuf_DescriptorProto *d, struct upb_string fqname, bool sort) { - /* TODO: more complete validation. - * TODO: re-enable this check when we properly set this flag. */ - //if(!d->set_flags.has.field) return false; + /* TODO: more complete validation. */ + if(!d->set_flags.has.field) return false; upb_inttable_init(&m->fields_by_num, d->field->len, sizeof(struct upb_fieldsbynum_entry)); -- cgit v1.2.3