-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/core/adt: prevent early decrements in comprehensions
Pending arcs in comprehensions follow a slightly different code path and are evaluated a bit earlier to determine whether the fields will exist. We need to ensure that if a "complete all" path is agitated, we do not break incoming dependencies if we are not finalizing. Doing so might cause the closeContexts to be closed, causing an "already closed" panic when a matching pattern constraint is later evaluated. We enforce this by requiring `breakIncomingDeps` to take the current mode and then only commence when mode is finalize. Note that there are two call sites. We added two test cases, the reported one and a variant, each of which triggered a panic for the respective code paths. Fixes #3691 Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: Ib4e9dda97a002f2ac5f96f4b31985e6c7ddb4f07 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1207545 Reviewed-by: Daniel Martí <[email protected]> Unity-Result: CUE porcuepine <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
- Loading branch information
Showing
3 changed files
with
349 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.