-
Notifications
You must be signed in to change notification settings - Fork 159
Open
Description
Bug in cycle detection reported in #95. Thank you @alingse. This issue is to track the bug itself as opposed to the fix. Description below copied from #95.
use visited map[visit]int to check cycle might get some bad case.
the key reason was that, all the pp, p printer share a same map[visit]int
but when we process a struct refer a pointer value twice or more, this is not a cycle, it's just a repeat refer.
maybe use other helper data type for every branch when we call code pp = *p statement
maybe a slice is enough to detect.
branch 1 : [v1, v2, v3, v5]
branch 2 : [v1, v2, v3, v4]
branch 3 : [v1, v2, v3, v4, v1]
only branch3 should print a "CYCLIC REFERENCE"
Metadata
Metadata
Assignees
Labels
No labels