lib/ctf-ir/attributes.c: add assert()
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 16 May 2017 02:34:27 +0000 (22:34 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:43 +0000 (12:57 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
lib/ctf-ir/attributes.c

index 9e605690187105dc0f3dad0efd2c189a37161d61..f0029a048dbd9aad81168a58f46dbdc49450226f 100644 (file)
@@ -31,6 +31,7 @@
 #include <babeltrace/babeltrace-internal.h>
 #include <babeltrace/values.h>
 #include <inttypes.h>
+#include <assert.h>
 
 #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
This page took 0.026063 seconds and 4 git commands to generate.