Closed
Description
This test case crashes when compiled with gccgo. The parameter s
is read from the wrong position on the stack. The problem is most likely that the empty struct field in large
leads to a disagreement between the Go code and libffi.
package main
import (
"fmt"
"reflect"
)
type large struct {
f1, f2, f3, f4 *byte
empty struct{}
}
func F(str string, l large, s []string) {
if len(s) != 1 || s[0] != "hi" {
fmt.Printf("bad value for s: %v\n", s)
panic("bad slice")
}
}
func main() {
params := []reflect.Value{
reflect.ValueOf("str"),
reflect.ValueOf(large{}),
reflect.ValueOf([]string{"hi"}),
}
reflect.ValueOf(F).Call(params)
}