+2020-04-28 David Malcolm <dmalcolm@redhat.com>
+
+ PR analyzer/94816
+ * engine.cc (impl_region_model_context::on_unexpected_tree_code):
+ Handle NULL tree.
+ * region-model.cc (region_model::add_region_for_type): Handle
+ NULL type.
+ * region-model.h
+ (test_region_model_context::on_unexpected_tree_code): Handle NULL
+ tree.
+
2020-04-28 David Malcolm <dmalcolm@redhat.com>
PR analyzer/94447
logger * const logger = get_logger ();
if (logger)
logger->log ("unhandled tree code: %qs in %qs at %s:%i",
- get_tree_code_name (TREE_CODE (t)),
+ t ? get_tree_code_name (TREE_CODE (t)) : "(null)",
loc.get_impl_location ().m_function,
loc.get_impl_location ().m_file,
loc.get_impl_location ().m_line);
region_model::add_region_for_type (region_id parent_rid, tree type,
region_model_context *ctxt)
{
- gcc_assert (TYPE_P (type));
+ if (type)
+ {
+ gcc_assert (TYPE_P (type));
- if (region *new_region = make_region_for_type (parent_rid, type))
- return add_region (new_region);
+ if (region *new_region = make_region_for_type (parent_rid, type))
+ return add_region (new_region);
+ }
/* If we can't handle TYPE, return a placeholder region, and stop
exploring this path. */
FINAL OVERRIDE
{
internal_error ("unhandled tree code: %qs",
- get_tree_code_name (TREE_CODE (t)));
+ t ? get_tree_code_name (TREE_CODE (t)) : "(null)");
}
private:
+2020-04-28 David Malcolm <dmalcolm@redhat.com>
+
+ PR analyzer/94816
+ * g++.dg/analyzer/pr94816.C: New test.
+
2020-04-28 David Malcolm <dmalcolm@redhat.com>
PR analyzer/94447
--- /dev/null
+/* { dg-additional-options "-O" } */
+
+struct jr;
+
+struct ch {
+ int jr::*rx;
+};
+
+ch
+ad ()
+{
+ return ch ();
+}