[libcxx-commits] [libcxx] [libc++][hardening] Classify assertions related to leaks and syscalls. (PR #77164)
    Konstantin Varlamov via libcxx-commits 
    libcxx-commits at lists.llvm.org
       
    Fri Jan  5 17:07:10 PST 2024
    
    
  
================
@@ -461,7 +461,7 @@ path __current_path(error_code* ec) {
   Deleter deleter = &::free;
 #else
   auto size = ::pathconf(".", _PC_PATH_MAX);
-  _LIBCPP_ASSERT_UNCATEGORIZED(size >= 0, "pathconf returned a 0 as max size");
+  _LIBCPP_ASSERT_VALID_EXTERNAL_API_CALL(size >= 0, "pathconf returned a 0 as max size");
----------------
var-const wrote:
This condition is suspicious -- the comment seems to indicate it should be `size > 0`. Also, doesn't `0` indicate "no limit"? (I don't know if any platform can actually report that, though)
https://github.com/llvm/llvm-project/pull/77164
    
    
More information about the libcxx-commits
mailing list