Java: Add guards logic for SwitchExpr default cases.

This commit is contained in:
Anders Schack-Mulligen
2023-09-28 14:21:04 +02:00
parent 917a15647e
commit 94556078f1
2 changed files with 4 additions and 0 deletions

View File

@@ -57,6 +57,8 @@ predicate implies_v1(Guard g1, boolean b1, Guard g2, boolean b2) {
or
g1.(DefaultCase).getSwitch().getAConstCase() = g2 and b1 = true and b2 = false
or
g1.(DefaultCase).getSwitchExpr().getAConstCase() = g2 and b1 = true and b2 = false
or
exists(MethodAccess check, int argIndex | check = g1 |
conditionCheckArgument(check, argIndex, _) and
g2 = check.getArgument(argIndex) and