[llvm] [NativePDB] Fix crash in llvm-pdbutil (PR #164871)
    via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu Oct 23 13:46:01 PDT 2025
    
    
  
================
@@ -194,6 +194,8 @@ Error LazyRandomTypeCollection::visitRangeForType(TypeIndex TI) {
   }
 
   visitRange(TIB, Prev->Offset, TIE);
+  if (Records.size() <= TI.toArrayIndex())
+    return make_error<CodeViewError>("Type index too big");
----------------
Nerixyz wrote:
Could you explain why is this required _here_? At this point, we already visited the types. I'd expect the method to not visit any type if the type index is too high. Though it looks like, it would visit the last element. However, this wouldn't result in a crash.
https://github.com/llvm/llvm-project/pull/164871
    
    
More information about the llvm-commits
mailing list