From: Ivan Maidanski Date: Tue, 15 Mar 2016 20:42:43 +0000 (+0300) Subject: Add assertion for GC_new_kind boolean arguments X-Git-Tag: gc7_6_0~47 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cfeb527db24cc07b65d6f17f95b6b9f4531e01e6;p=gc Add assertion for GC_new_kind boolean arguments * misc.c (GC_new_kind_inner): Add assertions for "adjust" and "clear" arguments (should be zero or one). --- diff --git a/misc.c b/misc.c index b4550e16..680d69ec 100644 --- a/misc.c +++ b/misc.c @@ -1845,6 +1845,8 @@ GC_API unsigned GC_CALL GC_new_kind_inner(void **fl, GC_word descr, { unsigned result = GC_n_kinds; + GC_ASSERT(adjust == FALSE || adjust == TRUE); + GC_ASSERT(clear == FALSE || clear == TRUE); if (result < MAXOBJKINDS) { GC_n_kinds++; GC_obj_kinds[result].ok_freelist = fl;