403Webshell
Server IP : 217.160.0.212  /  Your IP : 216.73.217.64
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/loopvar/testdata/inlines/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/go-1.23/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