[libcxx-commits] [libcxx] [libc++] Add input validation for set_intersection() in debug mode. (PR #101508)
Iuri Chaer via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Aug 6 05:23:47 PDT 2024
================
@@ -95,6 +98,14 @@ __set_intersection(
_Compare&& __comp,
std::forward_iterator_tag,
std::forward_iterator_tag) {
+#if _LIBCPP_HARDENING_MODE == _LIBCPP_HARDENING_MODE_DEBUG
+ if (!__libcpp_is_constant_evaluated()) {
+ _LIBCPP_ASSERT_INTERNAL(
----------------
ichaer wrote:
I should have added a comment: I didn't do that because `_LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN` is enabled in `_LIBCPP_HARDENING_MODE_EXTENSIVE`, and I thought the cost wasn't appropriate. More about this in my response to https://github.com/llvm/llvm-project/pull/101508/files#r1702696227.
https://github.com/llvm/llvm-project/pull/101508
More information about the libcxx-commits
mailing list