<http://www.gnu.org/licenses/>. */
#include "config.h"
+#define INCLUDE_MEMORY
#include "system.h"
#include "coretypes.h"
#include "tree.h"
<http://www.gnu.org/licenses/>. */
#include "config.h"
+#define INCLUDE_MEMORY
#include "system.h"
#include "coretypes.h"
#include "context.h"
<http://www.gnu.org/licenses/>. */
#include "config.h"
+#define INCLUDE_MEMORY
#include "system.h"
#include "coretypes.h"
#include "tree.h"
<http://www.gnu.org/licenses/>. */
#include "config.h"
+#define INCLUDE_MEMORY
#include "system.h"
#include "coretypes.h"
#include "tree.h"
public:
virtual ~path_context () {}
- /* Hook for clients to split state with a non-standard path.
- Take ownership of INFO. */
- virtual void bifurcate (custom_edge_info *info) = 0;
+ /* Hook for clients to split state with a non-standard path. */
+ virtual void bifurcate (std::unique_ptr<custom_edge_info> info) = 0;
/* Hook for clients to terminate the standard path. */
virtual void terminate_path () = 0;
<http://www.gnu.org/licenses/>. */
#include "config.h"
+#define INCLUDE_MEMORY
#include "system.h"
#include "coretypes.h"
#include "pretty-print.h"
<http://www.gnu.org/licenses/>. */
#include "config.h"
+#define INCLUDE_MEMORY
#include "system.h"
#include "coretypes.h"
#include "tree.h"
}
void
-impl_region_model_context::bifurcate (custom_edge_info *info)
+impl_region_model_context::bifurcate (std::unique_ptr<custom_edge_info> info)
{
if (m_path_ctxt)
- m_path_ctxt->bifurcate (info);
- else
- delete info;
+ m_path_ctxt->bifurcate (std::move (info));
}
void
call_summary_replay r (cd, called_fn, summary, ext_state);
if (path_ctxt)
- path_ctxt->bifurcate (new call_summary_edge_info (cd,
- called_fn,
- summary,
- ext_state));
+ path_ctxt->bifurcate (make_unique<call_summary_edge_info> (cd,
+ called_fn,
+ summary,
+ ext_state));
}
}
void
- bifurcate (custom_edge_info *info) final override
+ bifurcate (std::unique_ptr<custom_edge_info> info) final override
{
if (m_state_at_bifurcation)
/* Verify that the state at bifurcation is consistent when we
= std::unique_ptr<program_state> (new program_state (*m_cur_state));
/* Take ownership of INFO. */
- m_custom_eedge_infos.safe_push (info);
+ m_custom_eedge_infos.safe_push (info.release ());
}
void terminate_path () final override
void purge_state_involving (const svalue *sval) final override;
- void bifurcate (custom_edge_info *info) final override;
+ void bifurcate (std::unique_ptr<custom_edge_info> info) final override;
void terminate_path () final override;
const extrinsic_state *get_ext_state () const final override
{
<http://www.gnu.org/licenses/>. */
#include "config.h"
+#define INCLUDE_MEMORY
#include "system.h"
#include "coretypes.h"
#include "tree.h"
/* Body of region_model::impl_call_pipe. */
if (cd.get_ctxt ())
{
- cd.get_ctxt ()->bifurcate (new failure (cd));
- cd.get_ctxt ()->bifurcate (new success (cd));
+ cd.get_ctxt ()->bifurcate (make_unique<failure> (cd));
+ cd.get_ctxt ()->bifurcate (make_unique<success> (cd));
cd.get_ctxt ()->terminate_path ();
}
}
if (cd.get_ctxt ())
{
- cd.get_ctxt ()->bifurcate (new failure (cd));
- cd.get_ctxt ()->bifurcate (new success_no_move (cd));
- cd.get_ctxt ()->bifurcate (new success_with_move (cd));
+ cd.get_ctxt ()->bifurcate (make_unique<failure> (cd));
+ cd.get_ctxt ()->bifurcate (make_unique<success_no_move> (cd));
+ cd.get_ctxt ()->bifurcate (make_unique<success_with_move> (cd));
cd.get_ctxt ()->terminate_path ();
}
}
/* Bifurcate state, creating a "not found" out-edge. */
if (cd.get_ctxt ())
- cd.get_ctxt ()->bifurcate (new strchr_call_info (cd, false));
+ cd.get_ctxt ()->bifurcate (make_unique<strchr_call_info> (cd, false));
/* The "unbifurcated" state is the "found" case. */
strchr_call_info found (cd, true);
}
void
-noop_region_model_context::bifurcate (custom_edge_info *info)
+noop_region_model_context::bifurcate (std::unique_ptr<custom_edge_info>)
{
- delete info;
}
void
/* Hook for clients to purge state involving SVAL. */
virtual void purge_state_involving (const svalue *sval) = 0;
- /* Hook for clients to split state with a non-standard path.
- Take ownership of INFO. */
- virtual void bifurcate (custom_edge_info *info) = 0;
+ /* Hook for clients to split state with a non-standard path. */
+ virtual void bifurcate (std::unique_ptr<custom_edge_info> info) = 0;
/* Hook for clients to terminate the standard path. */
virtual void terminate_path () = 0;
void purge_state_involving (const svalue *sval ATTRIBUTE_UNUSED) override {}
- void bifurcate (custom_edge_info *info) override;
+ void bifurcate (std::unique_ptr<custom_edge_info> info) override;
void terminate_path () override;
const extrinsic_state *get_ext_state () const override { return NULL; }
m_inner->purge_state_involving (sval);
}
- void bifurcate (custom_edge_info *info) override
+ void bifurcate (std::unique_ptr<custom_edge_info> info) override
{
- m_inner->bifurcate (info);
+ m_inner->bifurcate (std::move (info));
}
void terminate_path () override
<http://www.gnu.org/licenses/>. */
#include "config.h"
+#define INCLUDE_MEMORY
#include "system.h"
#include "coretypes.h"
#include "tree.h"
#include "analyzer/store.h"
#include "analyzer/region-model.h"
#include "analyzer/call-info.h"
+#include "make-unique.h"
int plugin_is_GPL_compatible;
if (ctxt)
{
/* Bifurcate state, creating a "failure" out-edge. */
- ctxt->bifurcate (new copy_failure (cd));
+ ctxt->bifurcate (make_unique<copy_failure> (cd));
/* The "unbifurcated" state is the "success" case. */
copy_success success (cd,
#include "analyzer/store.h"
#include "analyzer/region-model.h"
#include "analyzer/call-info.h"
+#include "make-unique.h"
int plugin_is_GPL_compatible;
if (cd.get_ctxt ())
{
/* Bifurcate state, creating a "failure" out-edge. */
- cd.get_ctxt ()->bifurcate (new copy_failure (cd));
+ cd.get_ctxt ()->bifurcate (make_unique<copy_failure> (cd));
/* The "unbifurcated" state is the "success" case. */
copy_success success (cd,