================
@@ -2681,12 +2687,35 @@ void CodeGenFunction::InitializeVTablePointers(const 
CXXRecordDecl *RD) {
 
 llvm::Value *CodeGenFunction::GetVTablePtr(Address This,
                                            llvm::Type *VTableTy,
-                                           const CXXRecordDecl *RD) {
+                                           const CXXRecordDecl *RD,
+                                           VTableAuthMode authMode) {
   Address VTablePtrSrc = This.withElementType(VTableTy);
   llvm::Instruction *VTable = Builder.CreateLoad(VTablePtrSrc, "vtable");
   TBAAAccessInfo TBAAInfo = CGM.getTBAAVTablePtrAccessInfo(VTableTy);
   CGM.DecorateInstructionWithTBAA(VTable, TBAAInfo);
 
+  if (auto authenticationInfo =
+            CGM.getVTablePointerAuthInfo(this, RD, 
This.emitRawPointer(*this))) {
+    if (authMode != VTableAuthMode::UnsafeUbsanStrip) {
+      VTable = cast<llvm::Instruction>(
+          EmitPointerAuthAuth(*authenticationInfo, VTable));
+      if (authMode == VTableAuthMode::MustTrap) {
----------------
asl wrote:

```suggestion
      if (AuthMode == VTableAuthMode::MustTrap) {
```

https://github.com/llvm/llvm-project/pull/94056
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to