Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 61c91b6

Browse files
committed
[CPP-340] Refactor MistypedFunctionArguments.ql further.
1 parent b58f414 commit 61c91b6

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

cpp/ql/src/Likely Bugs/Underspecified Functions/MistypedFunctionArguments.ql

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
import cpp
1616

1717
predicate arithTypesMatch(Type arg, Type parm) {
18-
arg instanceof ArithmeticType and
19-
parm instanceof ArithmeticType and
18+
arg = parm
19+
or
2020
arg.getSize() = parm.getSize() and
2121
(
2222
arg instanceof IntegralOrEnumType and
@@ -26,10 +26,9 @@ predicate arithTypesMatch(Type arg, Type parm) {
2626
parm instanceof FloatingPointType
2727
)
2828
}
29+
2930
pragma[inline]
3031
predicate pointerArgTypeMayBeUsed(Type arg, Type parm) {
31-
arg = parm
32-
or
3332
// arithmetic types
3433
arithTypesMatch(arg, parm)
3534
or
@@ -41,8 +40,6 @@ predicate pointerArgTypeMayBeUsed(Type arg, Type parm) {
4140

4241
pragma[inline]
4342
predicate argTypeMayBeUsed(Type arg, Type parm) {
44-
arg = parm
45-
or
4643
// arithmetic types
4744
arithTypesMatch(arg, parm)
4845
or

0 commit comments

Comments
 (0)