C++: Fix ValueNumbering for CopyInstruction

Querying for overlap type wasn't possible when this library was first
written. This change fixes FPs in `RedundantNullCheckSimple.ql` on
Wireshark and other real-world projects.
This commit is contained in:
Jonas Jensen
2019-05-29 16:26:05 +02:00
parent 120df6054b
commit a61aec9e63
5 changed files with 4 additions and 32 deletions

View File

@@ -105,7 +105,7 @@ struct S {
long **pplong;
void test_phi() {
while (*pplong != nullptr) { // GOOD [FALSE POSITIVE]
while (*pplong != nullptr) { // GOOD
pplong++;
}
}

View File

@@ -3,4 +3,3 @@
| RedundantNullCheckSimple.cpp:48:12:48:12 | Load: p | This null check is redundant because the value is $@ in any case | RedundantNullCheckSimple.cpp:51:10:51:11 | Load: * ... | dereferenced here |
| RedundantNullCheckSimple.cpp:79:7:79:9 | Load: * ... | This null check is redundant because the value is $@ in any case | RedundantNullCheckSimple.cpp:78:7:78:10 | Load: * ... | dereferenced here |
| RedundantNullCheckSimple.cpp:93:13:93:13 | Load: p | This null check is redundant because the value is $@ in any case | RedundantNullCheckSimple.cpp:92:13:92:18 | Load: * ... | dereferenced here |
| RedundantNullCheckSimple.cpp:108:12:108:18 | Load: * ... | This null check is redundant because the value is $@ in any case | RedundantNullCheckSimple.cpp:108:12:108:18 | Load: * ... | dereferenced here |