@@ -175,7 +175,7 @@ CGPointerAuthInfo CodeGenModule::getPointerAuthInfoForPointeeType(QualType T) {
175175// / pointer type.
176176static CGPointerAuthInfo getPointerAuthInfoForType (CodeGenModule &CGM,
177177 QualType PointerType) {
178- assert (PointerType->isSignableType ());
178+ assert (PointerType->isSignableType (CGM. getContext () ));
179179
180180 // Block pointers are currently not signed.
181181 if (PointerType->isBlockPointerType ())
@@ -209,7 +209,7 @@ emitLoadOfOrigPointerRValue(CodeGenFunction &CGF, const LValue &LV,
209209// / needlessly resigning the pointer.
210210std::pair<llvm::Value *, CGPointerAuthInfo>
211211CodeGenFunction::EmitOrigPointerRValue (const Expr *E) {
212- assert (E->getType ()->isSignableType ());
212+ assert (E->getType ()->isSignableType (getContext () ));
213213
214214 E = E->IgnoreParens ();
215215 if (const auto *Load = dyn_cast<ImplicitCastExpr>(E)) {
@@ -291,7 +291,10 @@ static bool equalAuthPolicies(const CGPointerAuthInfo &Left,
291291 if (Left.isSigned () != Right.isSigned ())
292292 return false ;
293293 return Left.getKey () == Right.getKey () &&
294- Left.getAuthenticationMode () == Right.getAuthenticationMode ();
294+ Left.getAuthenticationMode () == Right.getAuthenticationMode () &&
295+ Left.isIsaPointer () == Right.isIsaPointer () &&
296+ Left.authenticatesNullValues () == Right.authenticatesNullValues () &&
297+ Left.getDiscriminator () == Right.getDiscriminator ();
295298}
296299
297300// Return the discriminator or return zero if the discriminator is null.
@@ -642,10 +645,10 @@ llvm::Value *CodeGenFunction::authPointerToPointerCast(llvm::Value *ResultPtr,
642645 QualType SourceType,
643646 QualType DestType) {
644647 CGPointerAuthInfo CurAuthInfo, NewAuthInfo;
645- if (SourceType->isSignableType ())
648+ if (SourceType->isSignableType (getContext () ))
646649 CurAuthInfo = getPointerAuthInfoForType (CGM, SourceType);
647650
648- if (DestType->isSignableType ())
651+ if (DestType->isSignableType (getContext () ))
649652 NewAuthInfo = getPointerAuthInfoForType (CGM, DestType);
650653
651654 if (!CurAuthInfo && !NewAuthInfo)
@@ -667,10 +670,10 @@ Address CodeGenFunction::authPointerToPointerCast(Address Ptr,
667670 QualType SourceType,
668671 QualType DestType) {
669672 CGPointerAuthInfo CurAuthInfo, NewAuthInfo;
670- if (SourceType->isSignableType ())
673+ if (SourceType->isSignableType (getContext () ))
671674 CurAuthInfo = getPointerAuthInfoForType (CGM, SourceType);
672675
673- if (DestType->isSignableType ())
676+ if (DestType->isSignableType (getContext () ))
674677 NewAuthInfo = getPointerAuthInfoForType (CGM, DestType);
675678
676679 if (!CurAuthInfo && !NewAuthInfo)
0 commit comments