sessiond: validate existence of field reference received from LTTng-UST
[lttng-tools.git] / src / bin / lttng-sessiond / tsdl-trace-class-visitor.cpp
index d90f5eacd4cb2c8723ab576e7dc18423a4414ec8..bccd62737b01374284464c17213e991cc63f56fe 100644 (file)
@@ -349,8 +349,8 @@ private:
                type.element_type->accept(*this);
                _type_suffixes.emplace(fmt::format("[{}]",
                                _bypass_identifier_escape ?
-                                               type.length_field_name :
-                                                     escape_tsdl_identifier(type.length_field_name)));
+                                               *(type.length_field_location.elements_.end() - 1) :
+                                                       escape_tsdl_identifier(*(type.length_field_location.elements_.end() - 1))));
        }
 
        virtual void visit(const lst::static_length_blob_type& type) override final
@@ -372,7 +372,7 @@ private:
                                _trace_abi.byte_order, 8, lst::integer_type::signedness::UNSIGNED,
                                lst::integer_type::base::HEXADECIMAL);
                const auto array = lttng::make_unique<lst::dynamic_length_array_type>(
-                               type.alignment, std::move(uint8_element), type.length_field_name);
+                               type.alignment, std::move(uint8_element), type.length_field_location);
 
                visit(*array);
        }
@@ -425,8 +425,8 @@ private:
                _indentation_level++;
                _description += fmt::format("variant <{}> {{\n",
                                _bypass_identifier_escape ?
-                                               type.tag_name :
-                                                     escape_tsdl_identifier(type.tag_name));
+                                               *(type.selector_field_location.elements_.end() - 1) :
+                                                       escape_tsdl_identifier(*(type.selector_field_location.elements_.end() - 1)));
 
                /*
                 * The CTF 1.8 specification only recommends that implementations ignore
@@ -477,7 +477,7 @@ private:
                 */
                const auto char_sequence = lttng::make_unique<lst::dynamic_length_array_type>(
                                type.alignment, create_character_type(type.encoding_),
-                               type.length_field_name);
+                               type.length_field_location);
 
                visit(*char_sequence);
        }
@@ -547,7 +547,7 @@ void tsdl::trace_class_visitor::visit(const lttng::sessiond::trace::trace_class&
                        fmt::arg("packet_header_layout", packet_header_visitor.get_description()));
 
        /* Declare trace scope and type aliases. */
-       append_metadata_fragment(std::move(trace_class_tsdl));
+       append_metadata_fragment(trace_class_tsdl);
 }
 
 void tsdl::trace_class_visitor::visit(const lttng::sessiond::trace::clock_class& clock_class)
@@ -574,7 +574,7 @@ void tsdl::trace_class_visitor::visit(const lttng::sessiond::trace::clock_class&
                        fmt::arg("frequency", clock_class.frequency),
                        fmt::arg("offset", clock_class.offset));
 
-       append_metadata_fragment(std::move(clock_class_str));
+       append_metadata_fragment(clock_class_str);
 }
 
 void tsdl::trace_class_visitor::visit(const lttng::sessiond::trace::stream_class& stream_class)
This page took 0.023919 seconds and 4 git commands to generate.