jameysharp opened PR #5337 from isle-overlap-fixes
to main
:
Ulrich Weigand identified two bugs in this code due to it falsely claiming there were unreachable rules in the s390x backend. The fixes are:
- Add constraints for pure constructors.
I didn't notice that a constructor which is declared pure (which currently implies that it is fallible), when used on the left-hand side of a rule, can cause the rule to fail to match. Therefore, any constructors on the left-hand side must be noted as additional constraints on the rule, so that overlap checking can see them.
- Ignore subset-overlaps for rules with equality constraints
This eliminates false positives when checking for unreachable rules. It introduces false negatives instead but we prefer to fail to detect an error instead of claiming that valid input is wrong. We can implement a more accurate check later.
<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
jameysharp requested fitzgen for a review on PR #5337.
jameysharp edited PR #5337 from isle-overlap-fixes
to main
:
Ulrich Weigand identified two bugs in this code due to it falsely claiming there were unreachable rules in the s390x backend. The fixes are:
- Add constraints for pure constructors.
I didn't notice that a constructor which is declared pure (which currently implies that it is fallible), when used on the left-hand side of a rule, can cause the rule to fail to match. Therefore, any constructors on the left-hand side must be noted as additional constraints on the rule, so that overlap checking can see them.
- Ignore subset-overlaps for rules with equality constraints
This eliminates false positives when checking for unreachable rules. It introduces false negatives instead but we prefer to fail to detect an error instead of claiming that valid input is wrong. We can implement a more accurate check later.
Extracted from #5322.
fitzgen submitted PR review.
jameysharp merged PR #5337.
Last updated: Dec 23 2024 at 12:05 UTC