Skip to content

Commit fb6eaaa

Browse files
Format
1 parent e7455c0 commit fb6eaaa

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

cpp/common/src/codingstandards/cpp/rules/donotusepointerarithmetictoaddressdifferentarrays/DoNotUsePointerArithmeticToAddressDifferentArrays.qll

+9-9
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,15 @@ class CastedToBytePointer extends ArrayLikeAccess, Conversion {
104104
}
105105
}
106106

107-
predicate pointerRecastBarrier(DataFlow::Node barrier) {
108-
// Casting to a differently sized pointer
109-
exists(CStyleCast cast, Expr casted |
110-
cast.getExpr() = casted and casted = barrier.asConvertedExpr()
111-
|
112-
not casted.getType().(PointerType).getBaseType().getSize() =
113-
cast.getType().(PointerType).getBaseType().getSize()
114-
)
115-
}
107+
predicate pointerRecastBarrier(DataFlow::Node barrier) {
108+
// Casting to a differently sized pointer
109+
exists(CStyleCast cast, Expr casted |
110+
cast.getExpr() = casted and casted = barrier.asConvertedExpr()
111+
|
112+
not casted.getType().(PointerType).getBaseType().getSize() =
113+
cast.getType().(PointerType).getBaseType().getSize()
114+
)
115+
}
116116

117117
/**
118118
* A data-flow configuration that tracks access to an array to type to an array index expression.

0 commit comments

Comments
 (0)