Skip to content

opt: assert that ConstExpr do not wrap booleans#65638

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
mgartner:56253-const-should-not-wrap-bool
May 24, 2021
Merged

opt: assert that ConstExpr do not wrap booleans#65638
craig[bot] merged 1 commit intocockroachdb:masterfrom
mgartner:56253-const-should-not-wrap-bool

Conversation

@mgartner
Copy link
Copy Markdown
Contributor

This commit adds a memo.CheckExpr assertion that panics during a test
build if a true or false value are wrapped in a ConstExpr. Several
rules assume that this invariant is held in order to make matching
easier.

The assertion revealed two cases which violated this invariant. Both
have been fixed.

Fixes #56253

Release note: None

This commit adds a `memo.CheckExpr` assertion that panics during a test
build if a true or false value are wrapped in a `ConstExpr`. Several
rules assume that this invariant is held in order to make matching
easier.

The assertion revealed two cases which violated this invariant. Both
have been fixed.

Fixes cockroachdb#56253

Release note: None
@mgartner mgartner requested a review from rytaft May 24, 2021 21:11
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Collaborator

@rytaft rytaft left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 5 of 5 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @mgartner)

@mgartner
Copy link
Copy Markdown
Contributor Author

Thanks for the review.

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented May 24, 2021

Build succeeded:

@craig craig bot merged commit a514f72 into cockroachdb:master May 24, 2021
@mgartner mgartner deleted the 56253-const-should-not-wrap-bool branch May 24, 2021 23:02
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.

opt: prevent Const from wrapping True and False

3 participants