mirror of
https://github.com/github/codeql.git
synced 2026-05-03 04:39:29 +02:00
C++: Fix false positive
This commit is contained in:
@@ -81,5 +81,6 @@ predicate candidateVariable(Variable v) {
|
||||
from BooleanControllingAssignment ae, UndefReachability undef
|
||||
where
|
||||
candidateResult(ae) and
|
||||
not ae.isFromUninstantiatedTemplate(_) and
|
||||
not undef.reaches(_, ae.getLValue().(VariableAccess).getTarget(), ae.getLValue())
|
||||
select ae, "Use of '=' where '==' may have been intended."
|
||||
|
||||
@@ -13,6 +13,4 @@
|
||||
| test.cpp:82:7:82:11 | ... = ... | Use of '=' where '==' may have been intended. |
|
||||
| test.cpp:84:7:84:11 | ... = ... | Use of '=' where '==' may have been intended. |
|
||||
| test.cpp:92:17:92:22 | ... = ... | Use of '=' where '==' may have been intended. |
|
||||
| test.cpp:105:6:105:10 | ... = ... | Use of '=' where '==' may have been intended. |
|
||||
| test.cpp:113:6:113:10 | ... = ... | Use of '=' where '==' may have been intended. |
|
||||
| test.cpp:113:6:113:10 | ... = ... | Use of '=' where '==' may have been intended. |
|
||||
|
||||
@@ -102,7 +102,7 @@ void g(int *i_p, int cond) {
|
||||
template<typename>
|
||||
void h() {
|
||||
int x;
|
||||
if(x = 0) { // GOOD [FALSE POSITIVE]: x is not initialized so this is probably intensional
|
||||
if(x = 0) { // GOOD: x is not initialized so this is probably intensional
|
||||
}
|
||||
|
||||
int y = 0;
|
||||
|
||||
Reference in New Issue
Block a user