mirror of
https://github.com/github/codeql.git
synced 2026-01-06 11:10:23 +01:00
QL code and tests for C#/C++/JavaScript.
This commit is contained in:
19
cpp/ql/src/Critical/DeadCodeCondition.cpp
Normal file
19
cpp/ql/src/Critical/DeadCodeCondition.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
while(result) {
|
||||
if ( ... )
|
||||
...
|
||||
else if (result //wrong: this test is redundant
|
||||
&& result->flags != 0)
|
||||
...
|
||||
result = next(queue);
|
||||
}
|
||||
|
||||
|
||||
fp = fopen(log, "r");
|
||||
if (fp) {
|
||||
/*
|
||||
* large block of code
|
||||
*/
|
||||
if (!fp) { //wrong: always false
|
||||
... /* dead code */
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user