aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/analyzer/region.h4
-rw-r--r--gcc/analyzer/store.cc7
-rw-r--r--gcc/analyzer/store.h4
3 files changed, 12 insertions, 3 deletions
diff --git a/gcc/analyzer/region.h b/gcc/analyzer/region.h
index 60d8149..fd0d4a0 100644
--- a/gcc/analyzer/region.h
+++ b/gcc/analyzer/region.h
@@ -1151,6 +1151,10 @@ public:
void dump_to_pp (pretty_printer *pp, bool simple) const final override;
+ /* We assume string literals are immutable, so we don't track them in
+ the store. */
+ bool tracked_p () const final override { return false; }
+
tree get_string_cst () const { return m_string_cst; }
private:
diff --git a/gcc/analyzer/store.cc b/gcc/analyzer/store.cc
index 06151d8..e3dabf3 100644
--- a/gcc/analyzer/store.cc
+++ b/gcc/analyzer/store.cc
@@ -1103,6 +1103,13 @@ binding_map::remove_overlapping_bindings (store_manager *mgr,
/* class binding_cluster. */
+binding_cluster::binding_cluster (const region *base_region)
+: m_base_region (base_region), m_map (),
+ m_escaped (false), m_touched (false)
+{
+ gcc_assert (base_region->tracked_p ());
+}
+
/* binding_cluster's copy ctor. */
binding_cluster::binding_cluster (const binding_cluster &other)
diff --git a/gcc/analyzer/store.h b/gcc/analyzer/store.h
index 368b299..9b54c7b 100644
--- a/gcc/analyzer/store.h
+++ b/gcc/analyzer/store.h
@@ -544,9 +544,7 @@ public:
typedef hash_map <const binding_key *, const svalue *> map_t;
typedef map_t::iterator iterator_t;
- binding_cluster (const region *base_region)
- : m_base_region (base_region), m_map (),
- m_escaped (false), m_touched (false) {}
+ binding_cluster (const region *base_region);
binding_cluster (const binding_cluster &other);
binding_cluster& operator=(const binding_cluster &other);