From 88bb61f287784c316120ccd721cd405572aef794 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sat, 8 Jun 2019 13:24:46 +0200 Subject: [PATCH] compiler: return a valid (undef) value from a unsupported select Returning a nil value may lead to problems later on. Just return undef here, so that further compilation will at least be safe (the result will be discarded anyway). --- compiler/compiler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/compiler.go b/compiler/compiler.go index 866da871..821b6270 100644 --- a/compiler/compiler.go +++ b/compiler/compiler.go @@ -1721,7 +1721,7 @@ func (c *Compiler) parseExpr(frame *Frame, expr ssa.Value) (llvm.Value, error) { return retval, nil // {-1, false} } } - return llvm.Value{}, c.makeError(expr.Pos(), "unimplemented: "+expr.String()) + return llvm.Undef(c.getLLVMType(expr.Type())), c.makeError(expr.Pos(), "unimplemented: "+expr.String()) case *ssa.Slice: if expr.Max != nil { return llvm.Value{}, c.makeError(expr.Pos(), "todo: full slice expressions (with max): "+expr.Type().String())