1
0
mirror of https://github.com/golang/go synced 2024-11-26 10:08:23 -07:00

fix build: use temporary variable to avoid compiler error

R=r
CC=golang-dev
https://golang.org/cl/6612066
This commit is contained in:
Robert Griesemer 2012-10-07 18:16:04 -07:00
parent 0d9474206f
commit d5b570cdb1

View File

@ -169,7 +169,10 @@ func TestExprs(t *testing.T) {
t.Errorf("%s: %s", src, err)
continue
}
expr := pkg.Files[filename].Decls[0].(*ast.GenDecl).Specs[0].(*ast.ValueSpec).Values[0]
// TODO(gri) writing the code below w/o the decl variable will
// cause a 386 compiler error (out of fixed registers)
decl := pkg.Files[filename].Decls[0].(*ast.GenDecl)
expr := decl.Specs[0].(*ast.ValueSpec).Values[0]
str := exprString(expr)
if str != test.str {
t.Errorf("%s: got %s, want %s", test.src, str, test.str)