From 6c827042b878570fc8418a7d3c99b2657c2541da Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Thu, 2 Jul 2015 14:39:51 -0400 Subject: [PATCH] Fix: Remove overly-strict freeze check on variants and structures MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- formats/ctf/ir/event-types.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/formats/ctf/ir/event-types.c b/formats/ctf/ir/event-types.c index 91ab78c8..703e708e 100644 --- a/formats/ctf/ir/event-types.c +++ b/formats/ctf/ir/event-types.c @@ -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; -- 2.34.1