[llvm] [SamplePGO] Handle "sequence too long" errors more gracefully (PR #114982)

William Junda Huang via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 5 12:30:16 PST 2024


================
@@ -1112,9 +1114,13 @@ std::error_code SampleProfileReaderBinary::readNameTable() {
   bool UseMD5 = useMD5();
 
   NameTable.clear();
+  if (*Size > NameTable.max_size())
----------------
huangjd wrote:

Encapsulate this into a function that performs size check and reserves vector, and returns an error code if too large. 

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


More information about the llvm-commits mailing list