[libcxx-commits] [libcxx] [libc++][hardening] Categorize more 'valid-element-access' checks. (PR #71620)

Konstantin Varlamov via libcxx-commits libcxx-commits at lists.llvm.org
Tue Dec 19 01:44:01 PST 2023


================
@@ -593,9 +593,10 @@ class _LIBCPP_TEMPLATE_VIS __parser {
           || (same_as<_CharT, wchar_t> && sizeof(wchar_t) == 2)
 #    endif
   _LIBCPP_HIDE_FROM_ABI constexpr bool __parse_fill_align(_Iterator& __begin, _Iterator __end, bool __use_range_fill) {
-    _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__begin != __end,
-                                        "when called with an empty input the function will cause "
-                                        "undefined behavior by evaluating data not in the input");
+    _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(
+        __begin != __end,
+        "when called with an empty input the function will cause "
----------------
var-const wrote:

Thanks! It's a good suggestion, but for this PR specifically, I'd prefer to keep the delta as small as possible, even if it means leaving some less-than-perfect error messages in place. It would be good to do a follow-up to improve some messages, though.

https://github.com/llvm/llvm-project/pull/71620


More information about the libcxx-commits mailing list