Don't assume that __cxa_current_exception_type exists.
authorJim Ingham <jingham@apple.com>
Sat, 2 Nov 2019 00:20:31 +0000 (17:20 -0700)
committerJim Ingham <jingham@apple.com>
Sat, 2 Nov 2019 00:20:31 +0000 (17:20 -0700)
commit81cc5d1c7d3f7292e82e8611fcd4a2889278a218
tree30e30b5789691ced4ebad437e1def6248a191862
parent86cdf74dc871beaa70796e1b13834be5cd73d36a
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.
lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp