mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 12:03:41 +00:00
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).
This commit is contained in:
committed by
Ron Evans
parent
e169e3b996
commit
88bb61f287
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user