From ab0bf875a5f328a6710f4e48258979ae1bc8da1c Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 16 Apr 2017 16:02:53 +0000 Subject: Vendor import of compiler-rt trunk r300422: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300422 --- test/scudo/overflow.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/scudo/overflow.cpp') diff --git a/test/scudo/overflow.cpp b/test/scudo/overflow.cpp index c93a544ea0a07..d12824578524e 100644 --- a/test/scudo/overflow.cpp +++ b/test/scudo/overflow.cpp @@ -10,20 +10,20 @@ int main(int argc, char **argv) { - assert(argc == 2); ssize_t offset = sizeof(void *) == 8 ? 8 : 0; + + assert(argc == 2); + if (!strcmp(argv[1], "malloc")) { // Simulate a header corruption of an allocated chunk (1-bit) void *p = malloc(1U << 4); - if (!p) - return 1; + assert(p); ((char *)p)[-(offset + 1)] ^= 1; free(p); } if (!strcmp(argv[1], "quarantine")) { void *p = malloc(1U << 4); - if (!p) - return 1; + assert(p); free(p); // Simulate a header corruption of a quarantined chunk ((char *)p)[-(offset + 2)] ^= 1; -- cgit v1.2.3