-
Notifications
You must be signed in to change notification settings - Fork 277
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: avoid loops in debug printing
Printing adt values can cause infinite loops with structure sharing enabled. This is especially the case for partially evaluated Vertices, if a shared Vertex is printed for which the structural cycle is not yet detected. We use the recently added cycle detection mechanism to whether a node is cyclic and/or shared in a Vertex. This is a rather conservative method and may mark false positives. This is okay as it serves the purpose of avoiding printing cycles only and is not otherwise involved in operations. We could enabled printing with structure sharing in more tests, but this would produce rather large diffs. We could still consider this later, especially once the old evaluator has been removed and the output from the new evaluator become the new golden files. Issue #2884 Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com> Change-Id: Icc5641446c8b5b9a4d4f67b584ccaa7114939890 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1193845 TryBot-Result: CUEcueckoo <cueckoo@cuelang.org> Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com> Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
- Loading branch information
Showing
12 changed files
with
319 additions
and
295 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.