diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-05-05 10:25:45 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-05-05 10:25:45 +0200 |
| commit | afe402d20af0d54d4e0baeb9e70e668e2a26f188 (patch) | |
| tree | 58f79c51ee9c8a48939059a23c47d68751d55701 /prog/encodingexec.go | |
| parent | 9dfb5efa91fc0f051a1ddc88ace2867bb6b32275 (diff) | |
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.
Diffstat (limited to 'prog/encodingexec.go')
| -rw-r--r-- | prog/encodingexec.go | 2 |
1 files changed, 1 insertions, 1 deletions
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") } |
