Commit b65b77cc by Ian Lance Taylor

reflect: correctly handle direct interface typed receiver in Value.call

    
    A direct interface type's value method takes value receiver now.
    Don't pass pointer to the method function.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/175798

From-SVN: r271000
parent d9b120ce
e3ba8828baf60343316bb68002e94570ee63ad1e
fcbf847c3bf76fb475c9020e1c57057134407263
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
......@@ -401,7 +401,7 @@ func (v Value) call(op string, in []Value) []Value {
if v.flag&flagMethod != 0 {
nin++
}
firstPointer := len(in) > 0 && t.In(0).Kind() != Ptr && v.flag&flagMethodFn != 0
firstPointer := len(in) > 0 && ifaceIndir(t.In(0).common()) && v.flag&flagMethodFn != 0
params := make([]unsafe.Pointer, nin)
off := 0
if v.flag&flagMethod != 0 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment