From 8823fa6069452c86325b4d5a6065a0d4fd67f1a2 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Wed, 6 Apr 2016 16:12:26 -0700 Subject: Refactored upb_def_freeze() a bit per PR comments. --- upb/refcounted.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'upb/refcounted.c') diff --git a/upb/refcounted.c b/upb/refcounted.c index c8162f0..81ac798 100644 --- a/upb/refcounted.c +++ b/upb/refcounted.c @@ -838,8 +838,11 @@ void upb_refcounted_checkref(const upb_refcounted *r, const void *owner) { bool upb_refcounted_freeze(upb_refcounted *const*roots, int n, upb_status *s, int maxdepth) { int i; + bool ret; for (i = 0; i < n; i++) { assert(!roots[i]->is_frozen); } - return freeze(roots, n, s, maxdepth); + ret = freeze(roots, n, s, maxdepth); + assert(!s || ret == upb_ok(s)); + return ret; } -- cgit v1.2.3