From 56984e8db8e1c43687535cc77fb6ce43df0b3d1f Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Fri, 29 Jul 2011 17:49:59 -0700 Subject: Significant work on Lua extension. Also changes in core library to accommodate. --- upb/descriptor.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'upb/descriptor.c') diff --git a/upb/descriptor.c b/upb/descriptor.c index 568a0d2..fbaef29 100644 --- a/upb/descriptor.c +++ b/upb/descriptor.c @@ -367,11 +367,13 @@ static void upb_fielddef_endmsg(void *_r, upb_status *status) { upb_fielddef *f = r->f; // TODO: verify that all required fields were present. assert(f->number != -1 && f->name != NULL); - assert((f->def != NULL) == upb_hasdef(f)); + assert((f->def != NULL) == upb_hassubdef(f)); // Field was successfully read, add it as a field of the msgdef. upb_msgdef *m = upb_descreader_top(r); upb_msgdef_addfield(m, f); + upb_fielddef_unref(f); + r->f = NULL; char *dstr = r->default_string; r->default_string = NULL; upb_value val; -- cgit v1.2.3