blob: e19d1a707ba6f4f2e96a24937d2161cb9a1d6b7a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#include <stdio.h>
#include <stdlib.h>
namespace NameSpace {
class Class {
public:
int Aborter(double x, char y, int *z) {
int addr = x + y + (int)z;
void *p = (void *)addr;
for (int i = 0; i < 100; i++)
free(p); // will abort, should show proper stack trace
}
};
}
int main(int argc, char **argv) {
NameSpace::Class c;
c.Aborter(1.234, 'a', NULL);
return 0;
}
|