[compiler-rt] [scudo] Clean up string handling (PR #86364)
    via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue Mar 26 12:13:14 PDT 2024
    
    
  
================
@@ -35,7 +35,9 @@ template <typename T> class VectorNoCtor {
     DCHECK_LE(Size, capacity());
     if (Size == capacity()) {
       const uptr NewCapacity = roundUpPowerOfTwo(Size + 1);
-      reallocate(NewCapacity);
+      if (!reallocate(NewCapacity)) {
+        return;
+      }
----------------
ChiaHungDuan wrote:
Can we have another function like `try_push_back` to support this behavior and only silence the on that path? And/Or we can specialize the Vector<char> to use `try_push_back` so that other OOM usage on other Vector instantiations can still be detected. 
https://github.com/llvm/llvm-project/pull/86364
    
    
More information about the llvm-commits
mailing list