Skip to content

Commit 9336a3e

Browse files
committed
Some minor comments
1 parent 75ea8ff commit 9336a3e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

c/misra/src/rules/RULE-21-13/CtypeFunctionArgNotUnsignedCharOrEof.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ where
2727
not exists(CtypeFunction ctype, UnsignedCharType unsignedChar |
2828
ctypeCall = ctype.getACallToThisFunction()
2929
|
30-
/* The argument's value should be in the `unsigned char` range. */
30+
/* Case 1: The argument's value should be in the `unsigned char` range. */
3131
typeLowerBound(unsignedChar) <= lowerBound(ctypeCall.getAnArgument().getExplicitlyConverted()) and // consider casts
3232
upperBound(ctypeCall.getAnArgument().getExplicitlyConverted()) <= typeUpperBound(unsignedChar)
3333
or
34-
/* The argument's value is reachable from EOF. */
34+
/* Case 2: EOF flows to this argument without modifications. */
3535
exists(EOFInvocation eof |
3636
DataFlow::localFlow(DataFlow::exprNode(eof.getExpr()),
3737
DataFlow::exprNode(ctypeCall.getAnArgument()))

c/misra/src/rules/RULE-21-15/MemcpyMemmoveMemcmpArgNotPointersToCompatibleTypes.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ where
3030
dstType = fc.getArgument(0).getUnspecifiedType() and
3131
srcType = fc.getArgument(1).getUnspecifiedType() and
3232
(
33+
/* Case 1: dst and src are pointer types */
3334
dstType instanceof PointerType and
3435
srcType instanceof PointerType
3536
or
37+
/* Case 2: dst and src are array types */
3638
dstType instanceof ArrayType and
3739
srcType instanceof ArrayType
3840
) and

0 commit comments

Comments
 (0)