Fix: Remove overly-strict freeze check on variants and structures
[babeltrace.git] / formats / ctf / ir / event-types.c
index b336889b029efb208c525a17fb32e44b4301f048..703e708e228cde046aa7c74c6982b37cb92295b3 100644 (file)
@@ -1286,6 +1286,8 @@ struct bt_ctf_field_type *bt_ctf_field_type_variant_create(
        }
 
        bt_ctf_field_type_init(&variant->parent);
+       /* A variant's alignment is undefined */
+       variant->parent.declaration->alignment = 0;
        return &variant->parent;
 error:
        return NULL;
@@ -2135,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;
@@ -2267,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.024655 seconds and 4 git commands to generate.