Fix: bt_stream_class_map_clock_class(): copy field type when mapping
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 14 Feb 2018 19:54:39 +0000 (14:54 -0500)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 2 May 2019 03:32:03 +0000 (23:32 -0400)
commit8cd07f2c188a204dc61cebde12d5207ae99b1255
tree857d05c941fa0f8c75da058dd88f23bba2b64e84
parent79422a2b1a3d14e130fd0fc34280ed62546ffba3
Fix: bt_stream_class_map_clock_class(): copy field type when mapping

Issue
=====
When a CTF writer stream class's packet context type contains the
special field types `timestamp_begin`, `timestamp_end`, and `timestamp`,
they are automatically mapped to the stream class's clock's class when
the stream class is about to be frozen in bt_trace_add_stream_class().
However, because the field type is mapped as is without a prior copy, it
is possible that this field type is shared with other locations in the
metadata tree which should not be mapped to a clock class.

Solution
========
Before automatically mapping any field type to a clock class, or more
generally, before modifying any field type, make a copy and replace the
original within its parent.

Known drawbacks
===============
None.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
lib/ctf-ir/stream-class.c
lib/ctf-ir/trace.c
This page took 0.025357 seconds and 4 git commands to generate.