diff --git a/tests/practical/use-after-free.c b/tests/practical/use-after-free.c deleted file mode 100644 index 77fc912313..0000000000 --- a/tests/practical/use-after-free.c +++ /dev/null @@ -1,7 +0,0 @@ -#include - -int main(void) { - int *x = malloc(16); - free(x); - asm ("nop" : "=x" (*x)); -} diff --git a/tests/regression/79-assembly/03-asm-use-after-free.c b/tests/regression/79-assembly/03-asm-use-after-free.c new file mode 100644 index 0000000000..47d57f92f6 --- /dev/null +++ b/tests/regression/79-assembly/03-asm-use-after-free.c @@ -0,0 +1,11 @@ +//PARAM: --set ana.activated[+] useAfterFree --disable asm_is_nop +#include + +int main(void) { + int *x = malloc(16); + free(x); + // write + asm ("nop" : "=x" (*x)); // WARN + // read + asm ("nop" : : "x" (*x)); // WARN +}