modernc.org/gc@v1.0.1-0.20240304020402-f0dba7c97c2b/testdata/errchk/test/fixedbugs/issue22941.dir/b.go (about)

     1  // Copyright 2017 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package p
     6  
     7  import q "./a"
     8  
     9  type T struct {
    10  	X *q.P
    11  }
    12  
    13  func F(in, out *T) {
    14  	*out = *in
    15  	if in.X != nil {
    16  		in, out := &in.X, &out.X
    17  		if *in == nil {
    18  			*out = nil
    19  		} else {
    20  			*out = new(q.P)
    21  			**out = **in
    22  		}
    23  	}
    24  	return
    25  }
    26  
    27  //go:noinline
    28  func G(x, y *T) {
    29  	F(x, y)
    30  }