Skip to content

Commit e728f34

Browse files
committed
Add verifier check
Created using spr 1.3.6-beta.1
1 parent f4981a9 commit e728f34

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

llvm/lib/IR/Verifier.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2627,6 +2627,11 @@ void Verifier::visitConstantPtrAuth(const ConstantPtrAuth *CPA) {
26272627

26282628
Check(CPA->getDiscriminator()->getBitWidth() == 64,
26292629
"signed ptrauth constant discriminator must be i64 constant integer");
2630+
2631+
Check(isa<GlobalValue>(CPA->getDeactivationSymbol()) ||
2632+
CPA->getDeactivationSymbol()->isNullValue(),
2633+
"signed ptrauth constant deactivation symbol must be a global value "
2634+
"or null");
26302635
}
26312636

26322637
bool Verifier::verifyAttributeCount(AttributeList Attrs, unsigned Params) {
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
; RUN: not opt -passes=verify < %s 2>&1 | FileCheck %s
2+
3+
@g = external global i8
4+
5+
; CHECK: signed ptrauth constant deactivation symbol must be a global variable or null
6+
@ptr = global ptr ptrauth (ptr @g, i32 0, i64 65535, ptr null, ptr inttoptr (i64 16 to ptr))

0 commit comments

Comments
 (0)