[clang] -fsanitize=function: fix MSVC hashing to sugared type (PR #66816)
Reid Kleckner via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 20 12:43:53 PDT 2023
rnk wrote:
It is true that the MSVC mangler doesn't generally canonicalize types, but I think we can canonicalize in the `mangleTypeName` entry point, because it exists to create unique type names for TBAA and CFI. You can audit the callers, they all relate to either of those two things.
Unrelatedly, we should not mangle names inside a sort comparator like this:
https://github.com/llvm/llvm-project/blob/5d95d27e50c1f5ce4803039d942ff3c25401c77f/clang/lib/CodeGen/CGVTables.cpp#L1319
This is wildly inefficient, we should be using a decorated sorting pattern instead, i.e. compute the hash upfront, make a pair with AddressPoint, and compare like that. I see the comparator dates to the initial CFI implementation:
https://github.com/llvm/llvm-project/commit/2c7f7e31c4c0afc84f8614a48ef7e1449b458c58#diff-1f66c1bfb33dd4d7809249cc89f056ab5688937c31c79b7ffc28bcb3d350a184R914
https://github.com/llvm/llvm-project/pull/66816
More information about the cfe-commits
mailing list