Fix: Remove overly-strict freeze check on variants and structures
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 2 Jul 2015 18:39:51 +0000 (14:39 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 2 Jul 2015 18:39:51 +0000 (14:39 -0400)
bt_ctf_field_type_structure_set_field_index() and
bt_ctf_field_type_variant_set_field_index() are both internal APIs
which are used when resolving field paths.

For exemple, when a sequence's field path is resolved, the sequence
is copied and replaced in its parent since we are setting the
resolved path as part of the sequence. This is done so that different
sequence members which would have been declared using the same sequence
type instance can have length fields which resolve to different absolute
paths.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
formats/ctf/ir/event-types.c

index 91ab78c86bc05a8196daab4ec2f95f34e9d21c8e..703e708e228cde046aa7c74c6982b37cb92295b3 100644 (file)
@@ -2137,7 +2137,7 @@ int bt_ctf_field_type_structure_set_field_index(struct bt_ctf_field_type *type,
        int ret = 0;
        struct bt_ctf_field_type_structure *structure;
 
-       if (!type || !field || type->frozen ||
+       if (!type || !field ||
                bt_ctf_field_type_get_type_id(type) != CTF_TYPE_STRUCT) {
                ret = -1;
                goto end;
@@ -2269,7 +2269,7 @@ int bt_ctf_field_type_variant_set_field_index(struct bt_ctf_field_type *type,
        int ret = 0;
        struct bt_ctf_field_type_variant *variant;
 
-       if (!type || !field || type->frozen ||
+       if (!type || !field ||
                bt_ctf_field_type_get_type_id(type) != CTF_TYPE_VARIANT) {
                ret = -1;
                goto end;
This page took 0.025938 seconds and 4 git commands to generate.