aboutsummaryrefslogtreecommitdiffstats
path: root/prog/encoding.go
diff options
context:
space:
mode:
Diffstat (limited to 'prog/encoding.go')
-rw-r--r--prog/encoding.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/prog/encoding.go b/prog/encoding.go
index 86577cd12..f0d96da95 100644
--- a/prog/encoding.go
+++ b/prog/encoding.go
@@ -33,7 +33,7 @@ func (p *Prog) Serialize() []byte {
vars := make(map[*ResultArg]int)
varSeq := 0
for _, c := range p.Calls {
- if len(c.Ret.uses) != 0 {
+ if c.Ret != nil && len(c.Ret.uses) != 0 {
fmt.Fprintf(buf, "r%v = ", varSeq)
vars[c.Ret] = varSeq
varSeq++
@@ -206,7 +206,7 @@ func (target *Target) Deserialize(data []byte) (prog *Prog, err error) {
if len(c.Args) != len(meta.Args) {
return nil, fmt.Errorf("wrong call arg count: %v, want %v", len(c.Args), len(meta.Args))
}
- if r != "" {
+ if r != "" && c.Ret != nil {
vars[r] = c.Ret
}
}