-
Notifications
You must be signed in to change notification settings - Fork 273
SSS: value-set-analysis adaptation #612
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
Merged
peterschrammel
merged 6 commits into
diffblue:security-scanner-support
from
smowton:sss_templatize_vsa
Mar 10, 2017
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c308d18
Value set: avoid potential infinite expression
smowton 83fd948
Add function id to value-set.
smowton 1a314e3
Value set: add declared-on-type entry member
smowton 913fbd9
Templatize and virtualize value-set analysis
smowton ff34029
Lint value-sets
smowton 87f1bce
Comment and slightly reformat strip_casts
smowton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,10 +10,10 @@ Author: Daniel Kroening, [email protected] | |
#define CPROVER_POINTER_ANALYSIS_SHOW_VALUE_SETS_H | ||
|
||
#include <util/ui_message.h> | ||
#include "value_set_analysis.h" | ||
|
||
class goto_functionst; | ||
class goto_programt; | ||
class value_set_analysist; | ||
|
||
void show_value_sets( | ||
ui_message_handlert::uit ui, | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,114 +8,13 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include <util/prefix.h> | ||
#include <util/cprover_prefix.h> | ||
#include <util/xml_expr.h> | ||
#include <util/xml.h> | ||
|
||
#include <langapi/language_util.h> | ||
|
||
#include "value_set_analysis.h" | ||
|
||
/*******************************************************************\ | ||
|
||
Function: value_set_analysist::initialize | ||
|
||
Inputs: | ||
|
||
Outputs: | ||
|
||
Purpose: | ||
|
||
\*******************************************************************/ | ||
|
||
void value_set_analysist::initialize( | ||
const goto_programt &goto_program) | ||
{ | ||
baset::initialize(goto_program); | ||
} | ||
|
||
/*******************************************************************\ | ||
|
||
Function: value_set_analysist::initialize | ||
|
||
Inputs: | ||
|
||
Outputs: | ||
|
||
Purpose: | ||
|
||
\*******************************************************************/ | ||
|
||
void value_set_analysist::initialize( | ||
const goto_functionst &goto_functions) | ||
{ | ||
baset::initialize(goto_functions); | ||
} | ||
|
||
/*******************************************************************\ | ||
|
||
Function: value_set_analysist::convert | ||
|
||
Inputs: | ||
|
||
Outputs: | ||
|
||
Purpose: | ||
|
||
\*******************************************************************/ | ||
|
||
void value_set_analysist::convert( | ||
const goto_programt &goto_program, | ||
const irep_idt &identifier, | ||
xmlt &dest) const | ||
{ | ||
source_locationt previous_location; | ||
|
||
forall_goto_program_instructions(i_it, goto_program) | ||
{ | ||
const source_locationt &location=i_it->source_location; | ||
|
||
if(location==previous_location) | ||
continue; | ||
|
||
if(location.is_nil() || location.get_file()==irep_idt()) | ||
continue; | ||
|
||
// find value set | ||
const value_sett &value_set=(*this)[i_it].value_set; | ||
|
||
xmlt &i=dest.new_element("instruction"); | ||
i.new_element()=::xml(location); | ||
|
||
for(value_sett::valuest::const_iterator | ||
v_it=value_set.values.begin(); | ||
v_it!=value_set.values.end(); | ||
v_it++) | ||
{ | ||
xmlt &var=i.new_element("variable"); | ||
var.new_element("identifier").data= | ||
id2string(v_it->first); | ||
|
||
#if 0 | ||
const value_sett::expr_sett &expr_set= | ||
v_it->second.expr_set(); | ||
|
||
for(value_sett::expr_sett::const_iterator | ||
e_it=expr_set.begin(); | ||
e_it!=expr_set.end(); | ||
e_it++) | ||
{ | ||
std::string value_str= | ||
from_expr(ns, identifier, *e_it); | ||
|
||
var.new_element("value").data= | ||
xmlt::escape(value_str); | ||
} | ||
#endif | ||
} | ||
} | ||
} | ||
/*******************************************************************\ | ||
|
||
Function: convert | ||
|
||
Inputs: | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add a blank line after the return