[clang] [clang] Function type attribute to prevent CFI instrumentation (PR #135836)

Paul Kirth via cfe-commits cfe-commits at lists.llvm.org
Thu May 15 13:59:59 PDT 2025


================
@@ -693,6 +693,18 @@ CGCallee ItaniumCXXABI::EmitLoadOfMemberFunctionPointer(
   llvm::Constant *CheckTypeDesc;
   bool ShouldEmitCFICheck = CGF.SanOpts.has(SanitizerKind::CFIMFCall) &&
                             CGM.HasHiddenLTOVisibility(RD);
+
+  if (ShouldEmitCFICheck) {
+    if (const auto *BinOp = dyn_cast<BinaryOperator>(E)) {
+      if (BinOp->isPtrMemOp()) {
+        if (BinOp->getRHS()
----------------
ilovepi wrote:

Maybe combine these?

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


More information about the cfe-commits mailing list