/* If we have a heap-allocated region in the summary, then
it was allocated within the callee.
Create a new heap-allocated region to summarize this. */
- auto_sbitmap heap_regs_in_use (mgr->get_num_regions ());
+ auto_bitmap heap_regs_in_use;
get_caller_model ()->get_referenced_base_regions (heap_regs_in_use);
return mgr->get_or_create_region_for_heap_alloc (heap_regs_in_use);
}
const region *
region_model_manager::
-get_or_create_region_for_heap_alloc (const sbitmap &base_regs_in_use)
+get_or_create_region_for_heap_alloc (const bitmap &base_regs_in_use)
{
/* Try to reuse an existing region, if it's unreferenced in the
client state. */
The number of these within the analysis can grow arbitrarily.
They are still owned by the manager. */
const region *
- get_or_create_region_for_heap_alloc (const sbitmap &base_regs_in_use);
+ get_or_create_region_for_heap_alloc (const bitmap &base_regs_in_use);
const region *create_region_for_alloca (const frame_region *frame);
void log_stats (logger *logger, bool show_objs) const;
/* Determine which regions are referenced in this region_model, so that
we can reuse an existing heap_allocated_region if it's not in use on
this path. */
- auto_sbitmap base_regs_in_use (m_mgr->get_num_regions ());
+ auto_bitmap base_regs_in_use;
get_referenced_base_regions (base_regs_in_use);
const region *reg
= m_mgr->get_or_create_region_for_heap_alloc (base_regs_in_use);
reachable in this region_model. */
void
-region_model::get_referenced_base_regions (auto_sbitmap &out_ids) const
+region_model::get_referenced_base_regions (auto_bitmap &out_ids) const
{
reachable_regions reachable_regs (const_cast<region_model *> (this));
m_store.for_each_cluster (reachable_regions::init_cluster_cb,
(Zhongxing Xu, Ted Kremenek, and Jian Zhang)
http://lcs.ios.ac.cn/~xuzb/canalyze/memmodel.pdf */
-#include "sbitmap.h"
+#include "bitmap.h"
#include "selftest.h"
#include "analyzer/svalue.h"
#include "analyzer/region.h"
region_model_context *ctxt);
const region *create_region_for_alloca (const svalue *size_in_bytes,
region_model_context *ctxt);
- void get_referenced_base_regions (auto_sbitmap &out_ids) const;
+ void get_referenced_base_regions (auto_bitmap &out_ids) const;
tree get_representative_tree (const svalue *sval) const;
tree get_representative_tree (const region *reg) const;
--- /dev/null
+/* Regression test for ICE. */
+/* { dg-additional-options "-Wno-analyzer-possible-null-argument" } */
+/* { dg-additional-options "-Wno-analyzer-malloc-leak" } */
+/* { dg-additional-options "-Wno-analyzer-possible-null-dereference" } */
+
+/* { dg-additional-options "-O1 --param analyzer-max-svalue-depth=5" } */
+
+struct locale {
+ class _Impl;
+ _Impl *_M_impl;
+
+ template <typename _Facet>
+ locale (const locale &, _Facet *);
+
+ static locale
+ classic ();
+};
+
+struct locale::_Impl {
+ _Impl (_Impl, int);
+};
+
+template <typename _Facet>
+locale::locale (const locale &, _Facet *)
+{
+ new _Impl (*_M_impl, 1);
+}
+
+struct codecvt {
+ virtual void do_max_lengththrow ();
+};
+
+void
+test01 ()
+{
+ locale (locale::classic (), new codecvt);
+}