diff options
| author | varconst <varconsteq@gmail.com> | 2023-06-27 16:40:39 -0700 |
|---|---|---|
| committer | varconst <varconsteq@gmail.com> | 2023-06-28 15:10:31 -0700 |
| commit | cd0ad4216cb962f160b1b0054df6f72ce6f9f766 (patch) | |
| tree | 98f2f5f3ae1c721e9e954d374fe2b316ee86be96 /libcxx/src/system_error.cpp | |
| parent | 699e0bed4bfead826e210025bf33e5a1997c018b (diff) | |
[libc++][hardening][NFC] Introduce `_LIBCPP_ASSERT_UNCATEGORIZED`.
Replace most uses of `_LIBCPP_ASSERT` with
`_LIBCPP_ASSERT_UNCATEGORIZED`.
This is done as a prerequisite to introducing hardened mode to libc++.
The idea is to make enabling assertions an opt-in with (somewhat)
fine-grained controls over which categories of assertions are enabled.
The vast majority of assertions are currently uncategorized; the new
macro will allow turning on `_LIBCPP_ASSERT` (the underlying mechanism
for all kinds of assertions) without enabling all the uncategorized
assertions (in the future; this patch preserves the current behavior).
Differential Revision: https://reviews.llvm.org/D153816
Diffstat (limited to 'libcxx/src/system_error.cpp')
| -rw-r--r-- | libcxx/src/system_error.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libcxx/src/system_error.cpp b/libcxx/src/system_error.cpp index 190abfd703ab..1502c7de6ba5 100644 --- a/libcxx/src/system_error.cpp +++ b/libcxx/src/system_error.cpp @@ -103,7 +103,7 @@ handle_strerror_r_return(int strerror_return, char *buffer) { if (new_errno == EINVAL) return ""; - _LIBCPP_ASSERT(new_errno == ERANGE, "unexpected error from ::strerror_r"); + _LIBCPP_ASSERT_UNCATEGORIZED(new_errno == ERANGE, "unexpected error from ::strerror_r"); // FIXME maybe? 'strerror_buff_size' is likely to exceed the // maximum error size so ERANGE shouldn't be returned. std::abort(); |
