Skip to content

Commit 58f3a77

Browse files
authored
[libc++abi] Replace usage of raw assert by _LIBCXXABI_ASSERT (#80689)
We strive not to use raw assert(...) anymore in libc++abi in preparation for using the hardening framework.
1 parent c08d972 commit 58f3a77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libcxxabi/src/private_typeinfo.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@
4444
#include <cstdint>
4545
#include <cassert>
4646
#include <string.h>
47+
#include "abort_message.h"
4748

4849
#ifdef _LIBCXXABI_FORGIVING_DYNAMIC_CAST
49-
#include "abort_message.h"
5050
#include <sys/syslog.h>
5151
#include <atomic>
5252
#endif
@@ -470,7 +470,7 @@ __class_type_info::can_catch(const __shim_type_info* thrown_type,
470470
if (thrown_class_type == 0)
471471
return false;
472472
// bullet 2
473-
assert(adjustedPtr && "catching a class without an object?");
473+
_LIBCXXABI_ASSERT(adjustedPtr, "catching a class without an object?");
474474
__dynamic_cast_info info = {thrown_class_type, 0, this, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true, nullptr};
475475
info.number_of_dst_type = 1;
476476
thrown_class_type->has_unambiguous_public_base(&info, adjustedPtr, public_path);

0 commit comments

Comments
 (0)