Allow conversions to an array to panic

This commit is contained in:
Sauyon Lee
2021-08-17 09:28:11 -07:00
parent 2a5e7e24cd
commit f39e43e5d0

View File

@@ -1184,6 +1184,14 @@ module CFG {
}
private class ConversionExprTree extends PostOrderTree, ConversionExpr {
override Completion getCompletion() {
// conversions of a slice to an array pointer are the only kind that may panic
this.getType().(PointerType).getBaseType() instanceof ArrayType and
result = Panic()
or
result = Done()
}
override ControlFlow::Node getNode() { result = MkExprNode(this) }
override ControlFlowTree getChildTree(int i) { i = 0 and result = getOperand() }