Skip to content
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

Fix simplifier bug (Issue #1760) #1766

Merged
merged 2 commits into from
Jan 23, 2017
Merged

Fix simplifier bug (Issue #1760) #1766

merged 2 commits into from
Jan 23, 2017

Conversation

steven-johnson
Copy link
Contributor

Also, driveby change to add logging for Stmt mutations as well as Expr
mutations to SImplify, and to enable/disable them via ifdef. (Fixes Issue #1760)

Also, driveby change to add logging for Stmt mutations as well as Expr
mutations to SImplify, and to enable/disable them via ifdef.
// was being simplified incorrectly, but *only* if var was of type Bool.
Stmt then_clause = AssertStmt::make(b2, Expr(22));
Stmt else_clause = AssertStmt::make(b2, Expr(33));
check(IfThenElse::make(b1 == true, then_clause, else_clause),
Copy link
Member

Choose a reason for hiding this comment

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

(b1 == True) should probably simplify to b1. If it doesn't now, it probably will in the future. So this test might not actually test the thing you want. Maybe b1 == b2?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. Changed to b1 == b2 (and verified that this still triggered the issue if the fix is backed out).

@abadams abadams merged commit b4feef5 into master Jan 23, 2017
@steven-johnson steven-johnson deleted the simpler branch January 23, 2017 21:22
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.

None yet

2 participants