runtime: reimplement reflect.call to not use stack splitting.

R=golang-dev, r, khr, rsc
CC=golang-dev
https://golang.org/cl/12053043
This commit is contained in:
Keith Randall 2013-08-02 13:03:14 -07:00
parent b8c8cb8509
commit 9cd570680b
10 changed files with 321 additions and 24 deletions

View file

@ -3509,3 +3509,14 @@ func (x *exhaustive) Choose(max int) int {
func (x *exhaustive) Maybe() bool {
return x.Choose(2) == 1
}
func bigArgFunc(v [(1<<30)+64]byte) {
}
func TestBigArgs(t *testing.T) {
if !testing.Short() && ^uint(0)>>32 != 0 { // test on 64-bit only
v := new([(1<<30)+64]byte)
bigArgFunc(*v) // regular calls are ok
shouldPanic(func() {ValueOf(bigArgFunc).Call([]Value{ValueOf(*v)})}) // ... just not reflect calls
}
}