diff options
author | Josh Haberman <jhaberman@gmail.com> | 2017-01-23 16:56:39 -0800 |
---|---|---|
committer | Josh Haberman <jhaberman@gmail.com> | 2017-01-23 16:56:39 -0800 |
commit | 5aa01b46e41dcdbbd2dad6d1b7ecce9a60b8ce7a (patch) | |
tree | 209f30d355c86cd961412db9a2e1e25ca81e648b /upb | |
parent | 512130adf13809cb857c9a208d728514e5ea31fd (diff) |
A couple more fixes.
Diffstat (limited to 'upb')
-rw-r--r-- | upb/def.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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; + } } } |