403Webshell
Server IP : 217.160.0.212  /  Your IP : 216.73.217.75
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1073854427 ( 1073854427)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/go-1.23/src/cmd/compile/internal/test/testdata/reproducible/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/go-1.23/src/cmd/compile/internal/test/testdata/reproducible/issue38068.go
// Copyright 2020 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.

package issue38068

// A type with a couple of inlinable, non-pointer-receiver methods
// that have params and local variables.
type A struct {
	s    string
	next *A
	prev *A
}

// Inlinable, value-received method with locals and parms.
func (a A) double(x string, y int) string {
	if y == 191 {
		a.s = ""
	}
	q := a.s + "a"
	r := a.s + "b"
	return q + r
}

// Inlinable, value-received method with locals and parms.
func (a A) triple(x string, y int) string {
	q := a.s
	if y == 998877 {
		a.s = x
	}
	r := a.s + a.s
	return q + r
}

type methods struct {
	m1 func(a *A, x string, y int) string
	m2 func(a *A, x string, y int) string
}

// Now a function that makes references to the methods via pointers,
// which should trigger the wrapper generation.
func P(a *A, ms *methods) {
	if a != nil {
		defer func() { println("done") }()
	}
	println(ms.m1(a, "a", 2))
	println(ms.m2(a, "b", 3))
}

func G(x *A, n int) {
	if n <= 0 {
		println(n)
		return
	}
	// Address-taken local of type A, which will insure that the
	// compiler's writeType() routine will create a method wrapper.
	var a, b A
	a.next = x
	a.prev = &b
	x = &a
	G(x, n-2)
}

var M methods

func F() {
	M.m1 = (*A).double
	M.m2 = (*A).triple
	G(nil, 100)
}

Youez - 2016 - github.com/yon3zu
LinuXploit