Source file test/fixedbugs/issue15013.go

     1  // compile
     2  
     3  // Copyright 2016 The Go Authors. All rights reserved.
     4  // Use of this source code is governed by a BSD-style
     5  // license that can be found in the LICENSE file.
     6  
     7  // CL 21202 introduced a compiler crash in the handling of a varargs
     8  // function in the same recursive group as a function that calls it.
     9  // Nothing in the standard library caught the problem, so adding a test.
    10  
    11  package p
    12  
    13  func F1(p *int, a ...*int) (int, *int) {
    14  	if p == nil {
    15  		return F2(), a[0]
    16  	}
    17  	return 0, a[0]
    18  }
    19  
    20  func F2() int {
    21  	var i0, i1 int
    22  	a, _ := F1(&i0, &i1)
    23  	return a
    24  }
    25  

View as plain text