]> Cypherpunks repositories - gostls13.git/commit
cmd/gc: fix detection of initialization loop.
authorRémy Oudompheng <oudomphe@phare.normalesup.org>
Thu, 29 Aug 2013 08:16:09 +0000 (10:16 +0200)
committerRémy Oudompheng <oudomphe@phare.normalesup.org>
Thu, 29 Aug 2013 08:16:09 +0000 (10:16 +0200)
commit66c8935f732db28632b75aea456c682487febf15
treeeed996992f6b750e7628eb36e130533c75d4f58d
parenta9e119ac7006c273d0045bcbc8c8d1a83f58f264
cmd/gc: fix detection of initialization loop.

The compiler computes initialization order by finding
a spanning tree between a package's global variables.
But it does so by walking both variables and functions
and stops detecting cycles between variables when they
mix with a cycle of mutually recursive functions.

Fixes #4847.

R=golang-dev, daniel.morsing, rsc
CC=golang-dev
https://golang.org/cl/9663047
src/cmd/gc/sinit.c
test/fixedbugs/issue4847.go [new file with mode: 0644]