From bbb997891669d9531582e40e58d36069fd8ad583 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 15 Mar 2016 23:42:43 +0300 Subject: [PATCH] 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). --- misc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/misc.c b/misc.c index d28d3d81..d2455dd9 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; -- 2.40.0