summaryrefslogtreecommitdiff
path: root/upb/def.c
diff options
context:
space:
mode:
authorJosh Haberman <jhaberman@gmail.com>2017-01-23 16:56:39 -0800
committerJosh Haberman <jhaberman@gmail.com>2017-01-23 16:56:39 -0800
commit5aa01b46e41dcdbbd2dad6d1b7ecce9a60b8ce7a (patch)
tree209f30d355c86cd961412db9a2e1e25ca81e648b /upb/def.c
parent512130adf13809cb857c9a208d728514e5ea31fd (diff)
A couple more fixes.
Diffstat (limited to 'upb/def.c')
-rw-r--r--upb/def.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/upb/def.c b/upb/def.c
index 080cd92..5fe9e14 100644
--- a/upb/def.c
+++ b/upb/def.c
@@ -378,13 +378,14 @@ bool _upb_def_validate(upb_def *const*defs, size_t n, upb_status *s) {
} else if (def->type == UPB_DEF_FIELD) {
upb_status_seterrmsg(s, "standalone fielddefs can not be frozen");
goto err;
- } else if (def->type == UPB_DEF_ENUM) {
- if (!upb_validate_enumdef(upb_dyncast_enumdef(def), s)) {
- goto err;
- }
} else {
/* Set now to detect transitive closure in the second pass. */
def->came_from_user = true;
+
+ if (def->type == UPB_DEF_ENUM &&
+ !upb_validate_enumdef(upb_dyncast_enumdef(def), s)) {
+ goto err;
+ }
}
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback