Skip to content

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

Merged

Conversation

allredj
Copy link
Contributor

@allredj allredj commented Apr 18, 2017

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.

@allredj allredj force-pushed the string-solver-bugfix-symbol-map branch from e5ff09d to 2a3fcdc Compare April 18, 2017 10:00
@allredj allredj changed the title [string-refine] Correcting addition of symbol to symbol map Correcting addition of symbol to symbol map Apr 18, 2017
@@ -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]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that copy necessary?

Copy link
Contributor Author

@allredj allredj Apr 18, 2017

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const & ?

@allredj allredj force-pushed the string-solver-bugfix-symbol-map branch from 2a3fcdc to d731b75 Compare April 18, 2017 16:52
Copy link
Contributor

@smowton smowton left a 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>
Copy link
Member

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 =.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified to break after (.

@allredj allredj force-pushed the string-solver-bugfix-symbol-map branch from d731b75 to 9513ff5 Compare May 15, 2017 09:18
@allredj
Copy link
Contributor Author

allredj commented May 22, 2017

@peterschrammel does this PR look OK to you?

peterschrammel
peterschrammel previously approved these changes May 22, 2017
@allredj allredj force-pushed the string-solver-bugfix-symbol-map branch from 9513ff5 to 3e8a945 Compare June 2, 2017 08:38
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
@allredj allredj force-pushed the string-solver-bugfix-symbol-map branch from 3e8a945 to eb9a789 Compare June 6, 2017 08:35
@forejtv forejtv merged commit ac71afe into diffblue:test-gen-support Jun 6, 2017
@allredj allredj deleted the string-solver-bugfix-symbol-map branch June 7, 2017 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants