Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5e7b781 commit d5c8ea3Copy full SHA for d5c8ea3
1 file changed
cpp/ql/src/Likely Bugs/Memory Management/SuspiciousCallToMemset.ql
@@ -52,13 +52,13 @@ Type stripType(Type t) {
52
53
/**
54
* Holds if `t` points to `base` via a specified number of levels of pointer
55
- * indirection. Intermediate typedefs and array types are allowed.
+ * indirection. Intermediate typedefs and array types are allowed. Note that
56
+ * `base` is a stripped type (via `stripType`).
57
*/
58
predicate pointerIndirection(Type t, int indirection, Type base) {
- exists(Type u |
59
- u = stripType(t) and
60
- u = stripType(base) and
61
- not u instanceof PointerType and
+ (
+ base = stripType(t) and
+ not base instanceof PointerType and
62
indirection = 0
63
) or (
64
pointerIndirection(stripType(t).(PointerType).getBaseType(), indirection - 1, base)
0 commit comments