lambda isValueCompatible check: ensure throws is not treated as normal completion (IDEA-135581)

This commit is contained in:
Anna Kozlova
2015-01-26 20:19:16 +03:00
parent 6edc7c729c
commit 012e57d2ea
3 changed files with 24 additions and 1 deletions
@@ -731,7 +731,8 @@ public class ControlFlowUtil {
if (nextOffset == endOffset) {
final Instruction lastInstruction = flow.getInstructions().get(endOffset - 1);
isNormal = !(lastInstruction instanceof GoToInstruction && ((GoToInstruction)lastInstruction).isReturn);
isNormal = !(lastInstruction instanceof GoToInstruction && ((GoToInstruction)lastInstruction).isReturn) &&
!(lastInstruction instanceof ThrowToInstruction);
}
isNormal |= throwToOffset <= endOffset && !isLeaf(nextOffset) && canCompleteNormally[nextOffset];