lls := ll.Slice()
sawRcvr := false
var src *Node
- DclLoop:
for _, n2 := range fn.Name.Defn.Func.Dcl {
switch n2.Class {
case PPARAM:
if n.Op != OCALLFUNC && !sawRcvr {
escassignNilWhy(e, n2, n.Left.Left, "call receiver")
sawRcvr = true
- continue DclLoop
+ continue
}
if len(lls) == 0 {
- continue DclLoop
+ continue
}
src = lls[0]
if n2.Isddd && !n.Isddd {
}
escassignNilWhy(e, n2, src, "arg to recursive call")
if src != lls[0] {
- break DclLoop
+ // "..." arguments are untracked
+ for _, n2 := range lls {
+ if Debug['m'] > 3 {
+ fmt.Printf("%v::esccall:: ... <- %v, untracked\n", linestr(lineno), Nconv(n2, FmtShort))
+ }
+ escassignSinkNilWhy(e, src, n2, "... arg to recursive call")
+ }
+ // No more PPARAM processing, but keep
+ // going for PPARAMOUT.
+ lls = nil
+ continue
}
lls = lls[1:]
}
}
- // "..." arguments are untracked
- for _, n2 := range lls {
- if Debug['m'] > 3 {
- fmt.Printf("%v::esccall:: ... <- %v, untracked\n", linestr(lineno), Nconv(n2, FmtShort))
- }
- escassignSinkNilWhy(e, src, n2, "... arg to recursive call")
- }
-
return
}
--- /dev/null
+// compile
+
+// Copyright 2016 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// CL 21202 introduced a compiler crash in the handling of a varargs
+// function in the same recursive group as a function that calls it.
+// Nothing in the standard library caught the problem, so adding a test.
+
+package p
+
+func F1(p *int, a ...*int) (int, *int) {
+ if p == nil {
+ return F2(), a[0]
+ }
+ return 0, a[0]
+}
+
+func F2() int {
+ var i0, i1 int
+ a, _ := F1(&i0, &i1)
+ return a
+}