• Robert Griesemer's avatar
    cmd/compile: correct alias cycle detection · 48987baa
    Robert Griesemer authored
    The original fix (https://go-review.googlesource.com/c/go/+/35831)
    for this issue was incorrect as it reported cycles in cases where
    it shouldn't.
    
    Instead, use a different approach: A type cycle containing aliases
    is only a cycle if there are no type definitions. As soon as there
    is a type definition, alias expansion terminates and there is no
    cycle.
    
    Approach: Split sprint_depchain into two non-recursive and more
    easily understandable functions (cycleFor and cycleTrace),
    and use those instead for cycle reporting. Analyze the cycle
    returned by cycleFor before issueing an alias cycle error.
    
    Also: Removed original fix (main.go) which introduced a separate
    crash (#23823).
    
    Fixes #18640.
    Fixes #23823.
    Fixes #24939.
    
    Change-Id: Ic3707a9dec40a71dc928a3e49b4868c5fac3d3b7
    Reviewed-on: https://go-review.googlesource.com/118078Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
    48987baa
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...