Small fixes for detect_invalid_pointer_pairs.

Summary:
One test-case uses a wrong operation (should be subtraction).
Second test-case should declare a global variables before a tested one
in order to guarantee we will find a red-zone.

Reviewers: kcc, jakubjelinek, alekseyshl

Reviewed By: alekseyshl

Subscribers: kubamracek

Differential Revision: https://reviews.llvm.org/D41481

llvm-svn: 323162
This commit is contained in:
Alex Shlyapnikov 2018-01-22 23:28:52 +00:00
parent 322fcfee34
commit ac8217de83
2 changed files with 5 additions and 1 deletions

View File

@ -10,8 +10,12 @@ int foo(char *p, char *q) {
}
char global1[100] = {}, global2[100] = {};
char __attribute__((used)) smallest_global[5] = {};
char small_global[7] = {};
char __attribute__((used)) little_global[10] = {};
char __attribute__((used)) medium_global[4000] = {};
char large_global[5000] = {};
char __attribute__((used)) largest_global[6000] = {};
int main() {
// Heap allocated memory.

View File

@ -6,7 +6,7 @@
#include <stdlib.h>
int bar(char *p, char *q) {
return p <= q;
return p - q;
}
char global[10000] = {};