return pl
}
+// nodarg does something that depends on the value of
+// fp (this was previously completely undocumented).
+//
+// fp=1 corresponds to input args
+// fp=0 corresponds to output args
+// fp=-1 is a special case of output args for a
+// specific call from walk that previously (and
+// incorrectly) passed a 1; the behavior is exactly
+// the same as it is for 1, except that PARAMOUT is
+// generated instead of PARAM.
func nodarg(t *Type, fp int) *Node {
var n *Node
Fatalf("nodarg: not field %v", t)
}
- if fp == 1 {
+ if fp == 1 || fp == -1 {
var n *Node
for l := Curfn.Func.Dcl; l != nil; l = l.Next {
n = l.N
case 1: // input arg
n.Class = PPARAM
+ case -1: // output arg from paramstoheap
+ n.Class = PPARAMOUT
+
case 2: // offset output arg
Fatalf("shouldn't be used")
}