34
34
//
35
35
// _LIBCXX_DYNAMIC_FALLBACK is currently off by default.
36
36
37
-
38
- #include < string.h>
39
-
40
-
41
37
#ifdef _LIBCXX_DYNAMIC_FALLBACK
42
38
#include " abort_message.h"
39
+ #include < string.h>
43
40
#include < sys/syslog.h>
44
41
#endif
45
42
@@ -60,19 +57,31 @@ namespace __cxxabiv1
60
57
61
58
#pragma GCC visibility push(hidden)
62
59
60
+ #ifdef _LIBCXX_DYNAMIC_FALLBACK
61
+
63
62
inline
64
63
bool
65
64
is_equal (const std::type_info* x, const std::type_info* y, bool use_strcmp)
66
65
{
67
- #ifndef _WIN32
68
66
if (!use_strcmp)
69
67
return x == y;
70
68
return strcmp (x->name (), y->name ()) == 0 ;
69
+ }
70
+
71
+ #else // !_LIBCXX_DYNAMIC_FALLBACK
72
+
73
+ inline
74
+ bool
75
+ is_equal (const std::type_info* x, const std::type_info* y, bool )
76
+ {
77
+ #ifndef _WIN32
78
+ return x == y;
71
79
#else
72
80
return (x == y) || (strcmp (x->name (), y->name ()) == 0 );
73
- #endif
81
+ #endif
74
82
}
75
83
84
+ #endif // _LIBCXX_DYNAMIC_FALLBACK
76
85
77
86
// __shim_type_info
78
87
@@ -342,17 +351,8 @@ bool
342
351
__pbase_type_info::can_catch (const __shim_type_info* thrown_type,
343
352
void *&) const
344
353
{
345
- if (is_equal (thrown_type, &typeid (std::nullptr_t ), false )) return true ;
346
- bool use_strcmp = this ->__flags & (__incomplete_class_mask |
347
- __incomplete_mask);
348
- if (!use_strcmp) {
349
- const __pbase_type_info* thrown_pbase = dynamic_cast <const __pbase_type_info*>(
350
- thrown_type);
351
- if (!thrown_pbase) return false ;
352
- use_strcmp = thrown_pbase->__flags & (__incomplete_class_mask |
353
- __incomplete_mask);
354
- }
355
- return is_equal (this , thrown_type, use_strcmp);
354
+ return is_equal (this , thrown_type, false ) ||
355
+ is_equal (thrown_type, &typeid (std::nullptr_t ), false );
356
356
}
357
357
358
358
#ifdef __clang__
0 commit comments