Fix handling of parameter frame positions
This commit is contained in:
@@ -639,9 +639,9 @@ func (interp *Interpreter) Cfg(root *Node) []*Node {
|
||||
n.flen = scope.size + 1
|
||||
if len(n.child[0].child) > 0 {
|
||||
// Method: restore receiver frame location (used at run)
|
||||
list := []int{n.child[0].child[0].child[0].findex}
|
||||
n.framepos = append(list, n.child[2].framepos...)
|
||||
n.framepos = append(n.framepos, n.child[0].child[0].child[0].findex)
|
||||
}
|
||||
n.framepos = append(n.framepos, n.child[2].framepos...)
|
||||
scope = scope.pop()
|
||||
funcName := n.child[1].ident
|
||||
if canExport(funcName) {
|
||||
|
||||
@@ -432,10 +432,9 @@ func (n *Node) wrapNode(in []reflect.Value) []reflect.Value {
|
||||
}
|
||||
|
||||
// Unwrap input arguments from their reflect value and store them in the frame
|
||||
paramIndex := def.child[2].child[0].val.([]int)
|
||||
i := 0
|
||||
for _, arg := range in {
|
||||
frame.data[paramIndex[i]] = arg
|
||||
frame.data[def.framepos[i]] = arg
|
||||
i++
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user