[PATCH] D148868: [llvm-profdata] ProfileReader cleanup - preparation for MD5 refactoring

William Junda Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 3 15:45:00 PDT 2023


huangjd added inline comments.


================
Comment at: llvm/lib/ProfileData/SampleProfReader.cpp:714
   case SecNameTable: {
-    FixedLengthMD5 =
+    bool FixedLengthMD5 =
         hasSecFlag(Entry, SecNameTableFlags::SecFlagFixedLengthMD5);
----------------
davidxl wrote:
> Is this flag still used or can be asserted to be true?
It cannot be assumed true. User can specify 3 modes normally:
1. function name strings : ~SecFlagMD5Name && ~SecFlagFixedLengthMD5
2. ULEB128 MD5 : SecFlagMD5Name && ~SecFlagFixedLengthMD5
3. Fixed length MD5 : SecFlagMD5Name && SecFlagFixedLengthMD5
A malformed profile can specify ~SecFlagMD5Name && SecFlagFixedLengthMD5 and crash on the third added test case. I fixed the logic so that LLVM treats this case same as (3). 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148868/new/

https://reviews.llvm.org/D148868



More information about the llvm-commits mailing list