Skip to content

Commit 3103530

Browse files
committed
C++: Also fix the FP in 'cpp/comparison-canceling-subexpr'.
1 parent b2082cc commit 3103530

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cpp/ql/src/Likely Bugs/Arithmetic/ComparisonWithCancelingSubExpr.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ private predicate cancelingSubExprs(ComparisonOperation cmp, VariableAccess a1,
8585
exists(Variable v |
8686
exists(float m | m < 0 and cmpLinearSubVariable(cmp, v, a1, m)) and
8787
exists(float m | m > 0 and cmpLinearSubVariable(cmp, v, a2, m))
88-
)
88+
) and
89+
not any(ClassTemplateInstantiation inst).getATemplateArgument() = cmp.getParent*()
8990
}
9091

9192
from ComparisonOperation cmp, VariableAccess a1, VariableAccess a2

0 commit comments

Comments
 (0)