// Turn the .dot into SVG and splice into place
auto svg = dot::make_svg_from_graph (*graph);
- xp.append (std::move (svg));
+ if (svg)
+ xp.append (std::move (svg));
return wrapper;
}
-/* { dg-additional-options "-fdiagnostics-add-output=sarif:xml-state=yes" } */
+/* { dg-require-dot "" } */
/* { dg-additional-options "-fdiagnostics-add-output=experimental-html:javascript=no,show-state-diagrams=yes" } */
/* { dg-additional-options "-fdiagnostics-show-caret" } */
__analyzer_dump_path ();
{ dg-end-multiline-output "" } */
-/* Verify that some JSON was written to a file with the expected name. */
-/* { dg-final { verify-sarif-file } } */
-
-/* Use a Python script to verify various properties about the generated
- .sarif file:
- { dg-final { run-sarif-pytest state-diagram-5.c "state-diagram-5-sarif.py" } } */
-
/* Use a Python script to verify various properties about the generated
.html file:
- { dg-final { run-html-pytest state-diagram-5.c "state-diagram-5-html.py" } } */
+ { dg-final { run-html-pytest state-diagram-5-html.c "state-diagram-5-html.py" } } */
--- /dev/null
+/* { dg-additional-options "-fdiagnostics-add-output=sarif:xml-state=yes" } */
+
+#include "analyzer-decls.h"
+
+struct foo
+{
+ int m_ints[4];
+};
+
+struct bar
+{
+ struct foo m_foos[3];
+ int m_int;
+ char m_ch;
+};
+
+struct baz
+{
+ struct bar m_bars[2];
+ struct foo m_foos[5];
+};
+
+void test (void)
+{
+ struct baz baz_arr[2];
+ baz_arr[1].m_bars[1].m_foos[2].m_ints[1] = 42;
+ __analyzer_dump_path (); /* { dg-message "path" } */
+}
+
+/* Verify that some JSON was written to a file with the expected name. */
+/* { dg-final { verify-sarif-file } } */
+
+/* Use a Python script to verify various properties about the generated
+ .sarif file:
+ { dg-final { run-sarif-pytest state-diagram-5-sarif.c "state-diagram-5-sarif.py" } } */
void
printer::push_element (std::unique_ptr<element> new_element)
{
+ gcc_assert (new_element.get ());
element *parent = m_open_tags.back ();
m_open_tags.push_back (new_element.get ());
parent->add_child (std::move (new_element));
void
printer::append (std::unique_ptr<node> new_node)
{
+ gcc_assert (new_node.get ());
element *parent = m_open_tags.back ();
parent->add_child (std::move (new_node));
}