From 0e4802f6746b1756edde7f2bcc5d8dafe538a388 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Mon, 15 May 2017 22:34:27 -0400 Subject: [PATCH] lib/ctf-ir/attributes.c: add assert() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- lib/ctf-ir/attributes.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/ctf-ir/attributes.c b/lib/ctf-ir/attributes.c index 9e605690..f0029a04 100644 --- a/lib/ctf-ir/attributes.c +++ b/lib/ctf-ir/attributes.c @@ -31,6 +31,7 @@ #include #include #include +#include #define BT_CTF_ATTR_NAME_INDEX 0 #define BT_CTF_ATTR_VALUE_INDEX 1 @@ -313,12 +314,7 @@ int bt_ctf_attributes_freeze(struct bt_value *attr_obj) BT_LOGD("Freezing attributes object: value-addr=%p", attr_obj); count = bt_value_array_size(attr_obj); - if (count < 0) { - BT_LOGE("Cannot get array value's size: value-addr=%p", - attr_obj); - ret = -1; - goto end; - } + assert(count >= 0); /* * We do not freeze the array value object itself here, since -- 2.34.1