mirror of
https://github.com/golang/go.git
synced 2025-05-07 08:32:59 +00:00
Since the Go runtime treats it specially, so must the pointer analysis. Details: - Combine object.{val,typ} fields into 'data interface{}'. It may now hold a string, describing an instrinsically allocated object such as the command-line args. - extend Label accordingly; add Label.ReflectType() accessor. Also: document pointer analysis algorithm classification. R=crawshaw CC=golang-dev https://golang.org/cl/14156043
26 lines
364 B
Go
26 lines
364 B
Go
// +build ignore
|
|
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
type S int
|
|
|
|
var theS S
|
|
|
|
func (s *S) String() string {
|
|
print(s) // @pointsto main.theS
|
|
return ""
|
|
}
|
|
|
|
func main() {
|
|
print(os.Args) // @pointsto <command-line args>
|
|
fmt.Println("Hello, World!", &theS)
|
|
}
|
|
|
|
// @calls main.main -> fmt.Println
|
|
// @calls (*fmt.pp).handleMethods -> (*main.S).String
|