From 690c828b0b02fde189b40f5dad94fa480c0575a5 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Fri, 20 Apr 2018 17:14:05 +0000 Subject: Fix a crash when resolving overloads of C++ virtual methods. The isOverload() method needs to account for situations where the two methods being compared don't have the same number of arguments. rdar://problem/39542960 llvm-svn: 330450 --- .../lldbsuite/test/lang/cpp/virtual-overload/main.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-overload/main.cpp (limited to 'lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-overload/main.cpp') diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-overload/main.cpp b/lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-overload/main.cpp new file mode 100644 index 00000000000..79c482352f9 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-overload/main.cpp @@ -0,0 +1,17 @@ +// Test that lldb doesn't get confused by an overload of a virtual +// function of the same name. +struct Base { + virtual void f(int i) {} + virtual ~Base() {} +}; + +struct Derived : Base { + virtual void f(int i, int j) {} +}; + +int main(int argc, char **argv) { + Derived obj; + obj.f(1, 2); //% self.expect("fr var", "not crashing", substrs = ["obj"]) + return 0; +} + -- cgit v1.2.3