From 9cd4def1c6affbfdec410c7e9bfa2fad15ccdaf8 Mon Sep 17 00:00:00 2001 From: Frederic Riss Date: Fri, 1 Jun 2018 20:14:21 +0000 Subject: Fix Module::FindTypes to return the correct number of matches. In r331719, I changed Module::FindTypes not to limit the amount of types returned by the Symbol provider, because we want all possible matches to be able to filter them. In one code path, the filtering was applied to the TypeList without changing the number of types that gets returned. This is turn could cause consumers to access beyond the end of the TypeList. This patch fixes this case and also adds an assertion to TypeList::GetTypeAtIndex to catch those obvious programming mistakes. Triggering the condition in which we performed the incorrect access was not easy. It happened a lot in mixed Swift/ObjectiveC code, but I was able to trigger it in pure Objective C++ although in a contrieved way. rdar://problem/40254997 llvm-svn: 333786 --- .../Python/lldbsuite/test/lang/objcxx/class-name-clash/myobject.mm | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 lldb/packages/Python/lldbsuite/test/lang/objcxx/class-name-clash/myobject.mm (limited to 'lldb/packages/Python/lldbsuite/test/lang/objcxx/class-name-clash/myobject.mm') diff --git a/lldb/packages/Python/lldbsuite/test/lang/objcxx/class-name-clash/myobject.mm b/lldb/packages/Python/lldbsuite/test/lang/objcxx/class-name-clash/myobject.mm new file mode 100644 index 00000000000..051c4e5eb1d --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/lang/objcxx/class-name-clash/myobject.mm @@ -0,0 +1,7 @@ +#import + +@interface MyObject : NSObject +@end + +@implementation MyObject +@end -- cgit v1.2.3