1//
2// 11588.cpp
3//
4
5#include <iostream>
6
7class StgInfoTable {};
8
9class StgHeader
10{
11private:
12 StgInfoTable* info;
13public:
14 StgHeader()
15 {
16 info = new StgInfoTable();
17 }
18 ~StgHeader()
19 {
20 delete info;
21 }
22};
23
24class StgClosure
25{
26private:
27 StgHeader header;
28 StgClosure* payload[1];
29public:
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
44typedef unsigned long long int ptr_type;
45
46int 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

source code of lldb/test/API/commands/expression/issue_11588/main.cpp