-
Notifications
You must be signed in to change notification settings - Fork 273
Correcting addition of symbol to symbol map #837
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
Correcting addition of symbol to symbol map #837
Conversation
e5ff09d
to
2a3fcdc
Compare
@@ -187,7 +187,7 @@ void string_refinementt::add_symbol_to_symbol_map( | |||
symbol_resolve[lhs]=new_rhs; | |||
reverse_symbol_resolve[new_rhs].push_back(lhs); | |||
|
|||
std::list<exprt> symbols_to_update_with_new_rhs(reverse_symbol_resolve[rhs]); | |||
std::list<exprt> symbols_to_update_with_new_rhs(reverse_symbol_resolve[lhs]); |
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.
is that copy necessary?
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.
Indeed, the copy is not necessary. I just pushed the correction.
@@ -187,7 +187,7 @@ void string_refinementt::add_symbol_to_symbol_map( | |||
symbol_resolve[lhs]=new_rhs; | |||
reverse_symbol_resolve[new_rhs].push_back(lhs); | |||
|
|||
std::list<exprt> symbols_to_update_with_new_rhs(reverse_symbol_resolve[rhs]); | |||
std::list<exprt> symbols_to_update_with_new_rhs(reverse_symbol_resolve[lhs]); | |||
for(exprt item : symbols_to_update_with_new_rhs) |
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.
const & ?
2a3fcdc
to
d731b75
Compare
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.
I see nothing to object to (but don't understand exactly what this is doing)
@@ -187,7 +187,8 @@ void string_refinementt::add_symbol_to_symbol_map( | |||
symbol_resolve[lhs]=new_rhs; | |||
reverse_symbol_resolve[new_rhs].push_back(lhs); | |||
|
|||
std::list<exprt> symbols_to_update_with_new_rhs(reverse_symbol_resolve[rhs]); | |||
const std::list<exprt> |
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.
That looks a bit weird. I'd rather break after the ( or use assignment notation and break after =.
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.
Modified to break after (
.
d731b75
to
9513ff5
Compare
@peterschrammel does this PR look OK to you? |
9513ff5
to
3e8a945
Compare
There was a mistake that could cause looping over symbols in the map that don't actually need to be modified and could greatly slow down the analysis. Correction after review from Peter Schrammel: Use const reference for symbols_to_update_wit_new_rhs
3e8a945
to
eb9a789
Compare
There was a mistake that could cause looping over symbols in the map that don't actually need to be modified and could greatly slow down the analysis.