From 25cdf1e6f7dedeaa19ad10ca1c97c6f39894100a Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Wed, 10 Aug 2011 20:16:14 -0700 Subject: Fixed overzealous assert(). --- Makefile | 4 ++-- upb/def.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 314b69b..69549d9 100644 --- a/Makefile +++ b/Makefile @@ -397,7 +397,7 @@ lang_ext/lua/upb.so: lang_ext/lua/upb.c $(LIBUPB_PIC) # Python extension ############################################################# -PYTHON=python2.6-dbg +PYTHON=python PYTHONEXT=lang_ext/python/build/install/lib/python/upb/__init__.so python: $(PYTHONEXT) $(PYTHONEXT): $(LIBUPB_PIC) lang_ext/python/upb.c @@ -405,4 +405,4 @@ $(PYTHONEXT): $(LIBUPB_PIC) lang_ext/python/upb.c $(Q) cd lang_ext/python && $(PYTHON) setup.py build --debug install --home=build/install pythontest: $(PYTHONEXT) - cd lang_ext/python && cp test.py build/install/lib/python && valgrind $(PYTHON) ./build/install/lib/python/test.py + cd lang_ext/python && cp test.py build/install/lib/python && $(PYTHON) ./build/install/lib/python/test.py 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); -- cgit v1.2.3