From: Robert Griesemer Date: Mon, 18 Apr 2016 20:55:40 +0000 (-0700) Subject: cmd/compile: fix internal consistency check with binary exporter X-Git-Tag: go1.7beta1~614 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a5386f3c7dc7735aa4695647896ba94bab0341e0;p=gostls13.git cmd/compile: fix internal consistency check with binary exporter Per feedback from mdempsky from https://go-review.googlesource.com/22096. Also fix emitted position info. Change-Id: I7ff1967430867d922be8784832042c75d81df28b Reviewed-on: https://go-review.googlesource.com/22198 Run-TryBot: Robert Griesemer Reviewed-by: Matthew Dempsky TryBot-Result: Gobot Gobot --- diff --git a/src/cmd/compile/internal/gc/bexport.go b/src/cmd/compile/internal/gc/bexport.go index eee71291be..90b4edff18 100644 --- a/src/cmd/compile/internal/gc/bexport.go +++ b/src/cmd/compile/internal/gc/bexport.go @@ -558,16 +558,13 @@ func (p *exporter) typ(t *Type) { Fatalf("exporter: predeclared type missing from type map?") } - // TODO(gri) The assertion below is incorrect (crashes during all.bash), - // likely because of symbol shadowing (we expect the respective definition - // to point to us). Determine the correct Def so we get correct position - // info. - // if tsym.Def.Type != t { - // Fatalf("exporter: type definition doesn't point to us?") - // } + n := typenod(t) + if n.Type != t { + Fatalf("exporter: named type definition incorrectly set up") + } p.tag(namedTag) - p.pos(tsym.Def) // TODO(gri) this may not be the correct node - fix and add tests + p.pos(n) p.qualifiedName(tsym) // write underlying type