From: Russ Cox Date: Mon, 14 Dec 2020 18:20:06 +0000 (-0500) Subject: [dev.regabi] cmd/compile: add type assertion in regabi test X-Git-Tag: go1.17beta1~1539^2~300 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=88e1415d08;p=gostls13.git [dev.regabi] cmd/compile: add type assertion in regabi test Change-Id: I7da5165f3679736040be5bfbcea3d4a85deaff2e Reviewed-on: https://go-review.googlesource.com/c/go/+/277957 Trust: Russ Cox Reviewed-by: Matthew Dempsky --- diff --git a/src/cmd/compile/internal/gc/abiutilsaux_test.go b/src/cmd/compile/internal/gc/abiutilsaux_test.go index d90d1d45a0..5489a512d2 100644 --- a/src/cmd/compile/internal/gc/abiutilsaux_test.go +++ b/src/cmd/compile/internal/gc/abiutilsaux_test.go @@ -75,10 +75,7 @@ func tokenize(src string) []string { } func verifyParamResultOffset(t *testing.T, f *types.Field, r ABIParamAssignment, which string, idx int) int { - n := ir.AsNode(f.Nname) - if n == nil { - panic("not expected") - } + n := ir.AsNode(f.Nname).(*ir.Name) if n.Offset() != int64(r.Offset) { t.Errorf("%s %d: got offset %d wanted %d t=%v", which, idx, r.Offset, n.Offset(), f.Type)