Eliminate free-nonheap-object warning.
TEST_SETUP(Test);
+char *ptr_add(char *ptr, size_t offset) __attribute__((noinline));
+char *ptr_add(char *ptr, size_t offset) { return ptr + offset; }
+
int Test::Main() {
char * v = static_cast<char *>(malloc(0x400001));
char * nv = static_cast<char *>(realloc(v, 0x500001));
@@ -13,8 +16,8 @@ int Test::Main() {
free(v);
char *t = static_cast<char *>(malloc(70));
- free (t+7);
+ free (ptr_add(t, 7));
t = static_cast<char *>(malloc(0x400001));
- free (t+7);
+ free (ptr_add(t, 7));
return 0;
}
