1 | // |
---|---|
2 | // 11588.cpp |
3 | // |
4 | |
5 | #include <iostream> |
6 | |
7 | class StgInfoTable {}; |
8 | |
9 | class StgHeader |
10 | { |
11 | private: |
12 | StgInfoTable* info; |
13 | public: |
14 | StgHeader() |
15 | { |
16 | info = new StgInfoTable(); |
17 | } |
18 | ~StgHeader() |
19 | { |
20 | delete info; |
21 | } |
22 | }; |
23 | |
24 | class StgClosure |
25 | { |
26 | private: |
27 | StgHeader header; |
28 | StgClosure* payload[1]; |
29 | public: |
30 | StgClosure(bool make_payload = true) |
31 | { |
32 | if (make_payload) |
33 | payload[0] = new StgClosure(false); |
34 | else |
35 | payload[0] = NULL; |
36 | } |
37 | ~StgClosure() |
38 | { |
39 | if (payload[0]) |
40 | delete payload[0]; |
41 | } |
42 | }; |
43 | |
44 | typedef unsigned long long int ptr_type; |
45 | |
46 | int main() |
47 | { |
48 | StgClosure* r14_ = new StgClosure(); |
49 | r14_ = (StgClosure*)(((ptr_type)r14_ | 0x01)); // set the LSB to 1 for tagging |
50 | ptr_type r14 = (ptr_type)r14_; |
51 | int x = 0; |
52 | x = 3; |
53 | return (x-1); // Set breakpoint here. |
54 | } |
55 |