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).
Этот коммит содержится в:
родитель
e169e3b996
коммит
88bb61f287
1 изменённых файлов: 1 добавлений и 1 удалений
|
@ -1721,7 +1721,7 @@ func (c *Compiler) parseExpr(frame *Frame, expr ssa.Value) (llvm.Value, error) {
|
||||||
return retval, nil // {-1, false}
|
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:
|
case *ssa.Slice:
|
||||||
if expr.Max != nil {
|
if expr.Max != nil {
|
||||||
return llvm.Value{}, c.makeError(expr.Pos(), "todo: full slice expressions (with max): "+expr.Type().String())
|
return llvm.Value{}, c.makeError(expr.Pos(), "todo: full slice expressions (with max): "+expr.Type().String())
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче