Skip to content

Commit 81cc5d1

Browse files
committed
Don't assume that __cxa_current_exception_type exists.
Normally you shouldn't be able to have a process with an ItaniumABI plugin that doesn't have this symbol. But if the loader crashes before loading libc++abi.dylib (on MacOS), then the symbol might not be present. So we should check before accessing the pointer. There isn't a good way to write a test for this, but the change is obvious.
1 parent 86cdf74 commit 81cc5d1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,9 @@ ValueObjectSP ItaniumABILanguageRuntime::GetExceptionObjectForThread(
559559
modules.FindSymbolsWithNameAndType(
560560
ConstString("__cxa_current_exception_type"), eSymbolTypeCode, contexts);
561561
contexts.GetContextAtIndex(0, context);
562+
if (!context.symbol) {
563+
return {};
564+
}
562565
Address addr = context.symbol->GetAddress();
563566

564567
Status error;

0 commit comments

Comments
 (0)