GCC Middle and Back End API Reference
ana::uncertainty_t Class Reference

#include <store.h>

Collaboration diagram for ana::uncertainty_t:

Public Types

typedef hash_set< constsymbolic::value_node * >::iterator iterator

Public Member Functions

void on_maybe_bound_value (const symbolic::value_node &val)
void on_mutable_value_at_unknown_call (const symbolic::value_node &val)
bool unknown_sm_state_p (const svalue *sval)
void add_bit_contents (const symbolic::bit_contents &bc)
void dump () const
void dump_to_logger (logger &) const
std::unique_ptr< text_art::tree_widget > make_dump_widget (symbolic::node_dump_state &nds) const
iterator begin_maybe_bound_svals () const
iterator end_maybe_bound_svals () const

Private Attributes

hash_set< const symbolic::value_node * > m_maybe_bound_vals
hash_set< const symbolic::value_node * > m_mutable_at_unknown_call_vals

Detailed Description

A class for keeping track of aspects of a program_state that we don't
know about, to avoid false positives about leaks.

Consider:

   p->field = malloc (1024);
   q->field = NULL;

where we don't know whether or not p and q point to the same memory,
and:

   p->field = malloc (1024);
   unknown_fn (p);

In both cases, the svalue for the address of the allocated buffer
goes from being bound to p->field to not having anything explicitly bound
to it.

Given that we conservatively discard bindings due to possible aliasing or
calls to unknown function, the store loses references to svalues,
but these svalues could still be live.  We don't want to warn about
them leaking - they're effectively in a "maybe live" state.

This "maybe live" information is somewhat transient.

We don't want to store this "maybe live" information in the program_state,
region_model, or store, since we don't want to bloat these objects (and
potentially bloat the exploded_graph with more nodes).
However, we can't store it in the region_model_context, as these context
objects sometimes don't last long enough to be around when comparing the
old vs the new state.

This class is a way to track a set of such svalues, so that we can
temporarily capture that they are in a "maybe live" state whilst
comparing old and new states.   

Member Typedef Documentation

◆ iterator

typedef hash_set<constsymbolic::value_node*>::iterator ana::uncertainty_t::iterator

Member Function Documentation

◆ add_bit_contents()

void ana::uncertainty_t::add_bit_contents ( const symbolic::bit_contents & bc)

◆ begin_maybe_bound_svals()

iterator ana::uncertainty_t::begin_maybe_bound_svals ( ) const
inline

References m_maybe_bound_vals.

◆ dump()

void ana::uncertainty_t::dump ( ) const

◆ dump_to_logger()

void ana::uncertainty_t::dump_to_logger ( logger & ) const

◆ end_maybe_bound_svals()

iterator ana::uncertainty_t::end_maybe_bound_svals ( ) const
inline

References m_maybe_bound_vals.

◆ make_dump_widget()

std::unique_ptr< text_art::tree_widget > ana::uncertainty_t::make_dump_widget ( symbolic::node_dump_state & nds) const

◆ on_maybe_bound_value()

void ana::uncertainty_t::on_maybe_bound_value ( const symbolic::value_node & val)

◆ on_mutable_value_at_unknown_call()

void ana::uncertainty_t::on_mutable_value_at_unknown_call ( const symbolic::value_node & val)

◆ unknown_sm_state_p()

bool ana::uncertainty_t::unknown_sm_state_p ( const svalue * sval)

Field Documentation

◆ m_maybe_bound_vals

hash_set<const symbolic::value_node *> ana::uncertainty_t::m_maybe_bound_vals
private

◆ m_mutable_at_unknown_call_vals

hash_set<const symbolic::value_node *> ana::uncertainty_t::m_mutable_at_unknown_call_vals
private

The documentation for this class was generated from the following file: