From afe402d20af0d54d4e0baeb9e70e668e2a26f188 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 5 May 2018 10:25:45 +0200 Subject: prog: make c.Ret optional No reason to allocate return value if there is no return type. c.Ret == nil is the reasonable indication that this is a "void" call. --- prog/encodingexec.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'prog/encodingexec.go') diff --git a/prog/encodingexec.go b/prog/encodingexec.go index 9d918b155..a162a7126 100644 --- a/prog/encodingexec.go +++ b/prog/encodingexec.go @@ -152,7 +152,7 @@ func (p *Prog) SerializeForExec(buffer []byte) (int, error) { } // Generate the call itself. w.write(uint64(c.Meta.ID)) - if len(c.Ret.uses) != 0 { + if c.Ret != nil && len(c.Ret.uses) != 0 { if _, ok := w.args[c.Ret]; ok { panic("argInfo is already created for return value") } -- cgit mrf-deployment