Freeze original field type copied on validation
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 17 Nov 2016 02:00:54 +0000 (21:00 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 27 May 2017 18:09:06 +0000 (14:09 -0400)
commitb46969a9130bc1bc843513ad9ca72e2163d8eeda
tree46124e72133eaa0606611d9370516ff6b7cea95a
parente96045d4f186a5f3a7ed1f5585cf4cbfe890f579
Freeze original field type copied on validation

The following situation should fail:

    field_type = create a structure FT with a sequence
                 or variant FT field
    ec = bt_ctf_event_class_create("ec")
    bt_ctf_event_class_set_payload_type(ec, field_type)
    sc = bt_ctf_stream_class_create("sc")
    bt_ctf_stream_class_add_event_class(sc, ec)
    modify field_type in any way -> should fail

In this scenario, field_type gets copied when the
validation process is executed in bt_ctf_stream_class_create()
because it contains a sequence or variant FT.

The original field type, field_type, should also be frozen
when this validation succeeds so that it behaves like it was
not copied in the first place.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
formats/ctf/ir/validation.c
This page took 0.02577 seconds and 4 git commands to generate.