Make code in IntroduceIndexMatcher safer
EA-101119 Fixed
This commit is contained in:
+2
-2
@@ -69,8 +69,8 @@ object IntroduceIndexMatcher : TransformationMatcher {
|
|||||||
|
|
||||||
val pseudocode = state.pseudocodeProvider()
|
val pseudocode = state.pseudocodeProvider()
|
||||||
val firstStatement = state.statements.first()
|
val firstStatement = state.statements.first()
|
||||||
val firstInstruction = pseudocode.instructionForElement(firstStatement)!!
|
val firstInstruction = pseudocode.instructionForElement(firstStatement) ?: return null
|
||||||
val incrementInstruction = pseudocode.instructionForElement(incrementExpression)!!
|
val incrementInstruction = pseudocode.instructionForElement(incrementExpression) ?: return null
|
||||||
if (!isAlwaysReachedOrExitedLoop(firstInstruction, incrementInstruction, state.outerLoop, state.innerLoop)) return null
|
if (!isAlwaysReachedOrExitedLoop(firstInstruction, incrementInstruction, state.outerLoop, state.innerLoop)) return null
|
||||||
|
|
||||||
val variableDescriptor = variable.unsafeResolveToDescriptor() as VariableDescriptor
|
val variableDescriptor = variable.unsafeResolveToDescriptor() as VariableDescriptor
|
||||||
|
|||||||
Reference in New Issue
Block a user