brintos

brintos / llvm-project-archived public Read only

0
0
Text · 381 B · 4b2ff9d Raw
17 lines · cpp
1// REQUIRES: gwp_asan2// RUN: %clangxx_gwp_asan %s -o %t3// RUN: %expect_crash %run %t 2>&1 | FileCheck %s4 5// CHECK: GWP-ASan detected a memory error6// CHECK: Invalid (Wild) Free at 0x{{[a-f0-9]+}} (1 byte to the right of a7// CHECK-SAME: 1-byte allocation8 9#include <cstdlib>10 11int main() {12  char *Ptr =13      reinterpret_cast<char *>(malloc(1));14  free(Ptr + 1);15  return 0;16}17