From d835b789fa9174c300ec471618375cd1bf541156 Mon Sep 17 00:00:00 2001 From: Tagir Valeev Date: Fri, 29 Sep 2017 12:32:35 +0700 Subject: [PATCH] StandardInstructionVisitor: non-negative range for Enum.ordinal() --- .../codeInspection/dataFlow/StandardInstructionVisitor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/StandardInstructionVisitor.java b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/StandardInstructionVisitor.java index e6fb61ae81c9..e0f8e50fa8e3 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/StandardInstructionVisitor.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/StandardInstructionVisitor.java @@ -54,7 +54,8 @@ public class StandardInstructionVisitor extends InstructionVisitor { .register(CallMatcher.staticCall(CommonClassNames.JAVA_LANG_LONG, "numberOfLeadingZeros", "numberOfTrailingZeros", "bitCount"), LongRangeSet.range(0, Long.SIZE)) .register(CallMatcher.staticCall(CommonClassNames.JAVA_LANG_INTEGER, "numberOfLeadingZeros", "numberOfTrailingZeros", "bitCount"), - LongRangeSet.range(0, Integer.SIZE)); + LongRangeSet.range(0, Integer.SIZE)) + .register(CallMatcher.instanceCall(CommonClassNames.JAVA_LANG_ENUM, "ordinal").parameterCount(0), LongRangeSet.indexRange()); private final Set myReachable = new THashSet<>(); private final Set myCanBeNullInInstanceof = new THashSet<>();