From e169e3b99607f005f9a46c65526a5ec609503523 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sat, 8 Jun 2019 13:14:47 +0200 Subject: [PATCH] compiler: remove superfluous 'err' result in decodeFuncValue --- compiler/compiler.go | 5 +---- compiler/func.go | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/compiler/compiler.go b/compiler/compiler.go index 4364b03a..866da871 100644 --- a/compiler/compiler.go +++ b/compiler/compiler.go @@ -1333,10 +1333,7 @@ func (c *Compiler) parseCall(frame *Frame, instr *ssa.CallCommon) (llvm.Value, e value := c.getValue(frame, instr.Value) // This is a func value, which cannot be called directly. We have to // extract the function pointer and context first from the func value. - funcPtr, context, err := c.decodeFuncValue(value, instr.Value.Type().Underlying().(*types.Signature)) - if err != nil { - return llvm.Value{}, err - } + funcPtr, context := c.decodeFuncValue(value, instr.Value.Type().Underlying().(*types.Signature)) c.emitNilCheck(frame, funcPtr, "fpcall") return c.parseFunctionCall(frame, instr.Args, funcPtr, context, false), nil } diff --git a/compiler/func.go b/compiler/func.go index 2a2af954..8a2e1ab3 100644 --- a/compiler/func.go +++ b/compiler/func.go @@ -103,7 +103,7 @@ func (c *Compiler) extractFuncContext(funcValue llvm.Value) llvm.Value { // decodeFuncValue extracts the context and the function pointer from this func // value. This may be an expensive operation. -func (c *Compiler) decodeFuncValue(funcValue llvm.Value, sig *types.Signature) (funcPtr, context llvm.Value, err error) { +func (c *Compiler) decodeFuncValue(funcValue llvm.Value, sig *types.Signature) (funcPtr, context llvm.Value) { context = c.builder.CreateExtractValue(funcValue, 0, "") switch c.funcImplementation() { case funcValueDoubleword: