File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
cpp/misra/src/rules/RULE-9-5-1 Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -185,11 +185,10 @@ private newtype TAlertType =
185185 /* 4. The type size of the loop counter is smaller than that of the loop bound. */
186186 TLoopCounterSmallerThanLoopBound ( ForStmt forLoop , LegacyForLoopCondition forLoopCondition ) {
187187 forLoopCondition = forLoop .getCondition ( ) and
188- exists ( Type loopCounterType , Type loopBoundType |
189- loopCounterType = forLoopCondition .getLoopCounter ( ) .getType ( ) and
190- loopBoundType = forLoopCondition .getLoopBound ( ) .getType ( )
191- |
192- loopCounterType .getSize ( ) < loopBoundType .getSize ( )
188+ exists ( Expr loopCounter , Expr loopBound |
189+ loopCounter = forLoopCondition .getLoopCounter ( ) and
190+ loopBound = forLoopCondition .getLoopBound ( ) and
191+ upperBound ( loopCounter .getFullyConverted ( ) ) < upperBound ( loopBound .getFullyConverted ( ) )
193192 )
194193 } or
195194 /* 5-1-1. The loop bound is a variable that is mutated in the for loop. */
You can’t perform that action at this time.
0 commit comments