Skip to content

Goto analyzer 5 part3 #966

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/analyses/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ SRC = ai.cpp \
locals.cpp \
natural_loops.cpp \
reaching_definitions.cpp \
replace_symbol_ext.cpp \
static_analysis.cpp \
uninitialized_domain.cpp \
# Empty last line
Expand Down
11 changes: 8 additions & 3 deletions src/analyses/ai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ xmlt ai_domain_baset::output_xml(
{
std::ostringstream out;
output(out, ai, ns);
xmlt xml("domain");
xmlt xml("abstract_state");
xml.data=out.str();
return xml;
}
Expand Down Expand Up @@ -166,7 +166,7 @@ jsont ai_baset::output_json(
json_numbert(std::to_string(i_it->location_number));
location["sourceLocation"]=
json_stringt(i_it->source_location.as_string());
location["domain"]=find_state(i_it).output_json(*this, ns);
location["abstractState"]=find_state(i_it).output_json(*this, ns);

// Ideally we need output_instruction_json
std::ostringstream out;
Expand Down Expand Up @@ -427,7 +427,12 @@ bool ai_baset::do_function_call(
assert(l_end->is_end_function());

// do edge from end of function to instruction after call
std::unique_ptr<statet> tmp_state(make_temporary_state(get_state(l_end)));
const statet &end_state=get_state(l_end);

if(end_state.is_bottom())
return false; // function exit point not reachable

std::unique_ptr<statet> tmp_state(make_temporary_state(end_state));
tmp_state->transform(l_end, l_return, *this, ns);

// Propagate those
Expand Down
4 changes: 4 additions & 0 deletions src/analyses/ai.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ class ai_domain_baset
// a reasonable entry-point state
virtual void make_entry()=0;

virtual bool is_bottom() const=0;

virtual bool is_top() const=0;

// also add
//
// bool merge(const T &b, locationt from, locationt to);
Expand Down
Loading