From: Jérémie Galarneau Date: Thu, 2 Jul 2015 18:39:51 +0000 (-0400) Subject: Fix: Remove overly-strict freeze check on variants and structures X-Git-Tag: v2.0.0-pre1~1221 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=6c827042b878570fc8418a7d3c99b2657c2541da Fix: Remove overly-strict freeze check on variants and structures 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 --- 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;