summaryrefslogtreecommitdiff
path: root/upb
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2011-08-10 20:16:14 -0700
committerJoshua Haberman <jhaberman@gmail.com>2011-08-10 20:16:14 -0700
commit25cdf1e6f7dedeaa19ad10ca1c97c6f39894100a (patch)
tree26d65d522703939f0dff58a0eb9d68febcf18407 /upb
parent336268b3d7e8860e86171650882d0a4f7d62ecfd (diff)
Fixed overzealous assert().
Diffstat (limited to 'upb')
-rw-r--r--upb/def.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/upb/def.c b/upb/def.c
index 6d2930c..5a449c0 100644
--- a/upb/def.c
+++ b/upb/def.c
@@ -228,8 +228,10 @@ static void upb_fielddef_free(upb_fielddef *f) {
}
if (f->def) {
// We own a ref on the subdef iff we are not part of a msgdef.
- assert((f->msgdef == NULL) == (upb_dyncast_unresolveddef(f->def) != NULL));
- if (f->msgdef == NULL) upb_def_unref(f->def);
+ if (f->msgdef == NULL) {
+ if (f->def) upb_downcast_unresolveddef(f->def); // assert() check.
+ upb_def_unref(f->def);
+ }
}
free(f->name);
free(f);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback