fix various false positives in test-stress from valgrind

This commit is contained in:
daan 2022-10-29 14:37:55 -07:00
parent c61b365e76
commit a1f5a5d962
6 changed files with 50 additions and 36 deletions

View file

@ -16,17 +16,20 @@ int main(int argc, char** argv) {
mi_free(r);
// undefined access
// printf("undefined: %d\n", *q);
printf("undefined: %d\n", *q);
*q = 42;
// buffer overflow
// q[1] = 43;
q[1] = 43;
// buffer underflow
q[-1] = 44;
mi(free)(q);
// double free
// mi(free)(q);
mi(free)(q);
// use after free
printf("use-after-free: %d\n", *q);