-
Notifications
You must be signed in to change notification settings - Fork 1
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: fix index out of bound panic
The main issue here was that when a Vertex was cloned, in overlay.go, its corresponding closeContext was cloned first, alongside its group. Normally, the group of a closeContext associated with a Vertex has its group pointing to the Conjuncts of this Vertex, ensuring they are always the same. The copy made in the overlay code, however, only copied the slice pointers already allocated, but the two slices would get out of sync when more conjuncts were added. This caused the index to overrun. This fix also exposed another issue where the group can sometimes be empty. Although this is theoretically possible, the conditions under which this appeared are suspicious. This CL, therefore, added a TODO to investigate. A simplified reproducer for this is: A: v: "a" | "b" h: [_]: A h: a: v: *"a" | string h: b: v: *h.a.v | string h: ["b"]: v: *h.b.v | string This example also exposes the counter issue, three of which were added because of this change. Tests were added in this CL, as they cause a panic otherwise. Fixes #3597 A further related issue is fixed in a next CL. Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com> Change-Id: I61b6aafb2f439793388f9357001d8ec99a30da3f Dispatch-Trailer: {"type":"trybot","CL":1206926,"patchset":1,"ref":"refs/changes/26/1206926/1","targetBranch":"master"}
- Loading branch information
Showing
5 changed files
with
202 additions
and
18 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
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
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