You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Toposort depends on StructInfos in Vertices to include the Decl which
contains the StructInfo. It uses this to establish a parent-child
relationship which enables it to walk topologically over the
StructLits which contributed to a Vertex.
In evalv3, when creating a StructInfo, the closeContext may contain the
Decl we want.
In evalv2, when creating a StructInfo, the closeInfo may contain the
Decl we want, but this code was previously faulty: if the closeInfo had
a nil Decl, then we would search parent closeInfos. This is faulty
because it could feed into toposort the notion that a Decl is its own
parent, which leads to infinite loop and stack explosion.
Removing the search through any parent closeInfo solves this problem.
The effect of this actually reduces the difference for toposort between
evalv2 and evalv3, so it is beneficial in this regard too.
Fixes#3710.
Signed-off-by: Matthew Sackman <[email protected]>
Change-Id: I8a8e7c0e83386c20428bd2d8723d5b24f5181677
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1207989
Reviewed-by: Marcel van Lohuizen <[email protected]>
Reviewed-by: Daniel Martí <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
0 commit comments