aboutsummaryrefslogtreecommitdiffstats
path: root/prog/encodingexec.go
diff options
context:
space:
mode:
Diffstat (limited to 'prog/encodingexec.go')
-rw-r--r--prog/encodingexec.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/prog/encodingexec.go b/prog/encodingexec.go
index 1d5b5e870..d0c8f6c80 100644
--- a/prog/encodingexec.go
+++ b/prog/encodingexec.go
@@ -86,7 +86,7 @@ func (p *Prog) SerializeForExec(buffer []byte) (int, error) {
}
// Calculate arg offsets within structs.
// Generate copyin instructions that fill in data into pointer arguments.
- foreachArg(c, func(arg, _ Arg, _ *[]Arg) {
+ ForeachArg(c, func(arg Arg, _ *ArgCtx) {
if a, ok := arg.(*PointerArg); ok && a.Res != nil {
foreachSubargOffset(a.Res, func(arg1 Arg, offset uint64) {
addr := p.Target.PhysicalAddr(arg) + offset
@@ -167,7 +167,7 @@ func (p *Prog) SerializeForExec(buffer []byte) (int, error) {
w.writeArg(arg)
}
// Generate copyout instructions that persist interesting return values.
- foreachArg(c, func(arg, base Arg, _ *[]Arg) {
+ ForeachArg(c, func(arg Arg, _ *ArgCtx) {
if !isUsed(arg) {
return
}
@@ -176,9 +176,6 @@ func (p *Prog) SerializeForExec(buffer []byte) (int, error) {
// Idx is already assigned above.
case *ConstArg, *ResultArg:
// Create a separate copyout instruction that has own Idx.
- if _, ok := base.(*PointerArg); !ok {
- panic("arg base is not a pointer")
- }
info := w.args[arg]
info.Idx = copyoutSeq
copyoutSeq++