[lldb-dev] [Bug 22314] New: LLDB crashes when evaluating a function which receives a value object which has a virtual destructor
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Fri Jan 23 12:02:24 PST 2015
http://llvm.org/bugs/show_bug.cgi?id=22314
Bug ID: 22314
Summary: LLDB crashes when evaluating a function which receives
a value object which has a virtual destructor
Product: lldb
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: All Bugs
Assignee: lldb-dev at cs.uiuc.edu
Reporter: sivachandra at gmail.com
Classification: Unclassified
Consider the following code:
class Foo
{
public:
virtual ~Foo ();
int a;
};
Foo::~Foo () {}
Foo
zero1 (Foo f)
{
Foo foo1;
foo1.a = -f.a;
return foo1;
}
Foo
zero2 ()
{
Foo f;
f.a = 0;
return f;
}
int
zero3 (Foo f)
{
return -f.a;
}
int
main ()
{
Foo f;
return 0; // Break here
}
If after breaking at the marked line, I see this happening:
(lldb) p zero1(f)
Aborted (core dumped)
(lldb) p zero2()
(Foo) $0 = (a = 0)
(lldb) p zero3(f)
Aborted (core dumped)
This issue is probably related to the more general issue reported here:
http://llvm.org/bugs/show_bug.cgi?id=14437
I initially thought that the triviality of the class matters. However, things
work as expected if I make the destructor non-virtual.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20150123/f9834014/attachment.html>
More information about the lldb-dev
mailing list