Skip to content

Commit

Permalink
internal/core/adt: fix bug in bound simplification
Browse files Browse the repository at this point in the history
SimplifyBounds orders BoundValues in order to
simplify the operation. However, in doing so it
swapped the original values, but not the derivative
values xv and yv, causing these to be misaligned.

Also, we missed an opportunity to detect a failing
bound for integer values, namely >m & <n where
n == m+1.

This also changes when n.*Bound is set to nil.
This seems to have no effect, but it could help
not losing an error position.

This fix helps disjunctions fail earlier, improving
performance, although, of course, this should not
be relied on solely to handle disjunctions efficiently.

Issue #2850
Issue #3610

Signed-off-by: Marcel van Lohuizen <[email protected]>
Change-Id: I2eca009ae314193d416a2890241a25744d562a39
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1205397
TryBot-Result: CUEcueckoo <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
Reviewed-by: Matthew Sackman <[email protected]>
  • Loading branch information
mpvl committed Dec 9, 2024
1 parent 00fa80a commit f9e5b6a
Show file tree
Hide file tree
Showing 4 changed files with 903 additions and 11 deletions.
Loading

0 comments on commit f9e5b6a

Please sign in to comment.