Skip to content

Commit a780d18

Browse files
committed
Address review comment
Created using spr 1.3.6-beta.1
1 parent 60e836e commit a780d18

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

llvm/lib/Bitcode/Reader/BitcodeReader.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,6 +1613,9 @@ Expected<Value *> BitcodeReader::materializeValue(unsigned StartValID,
16131613
ConstOps.size() > 4 ? ConstOps[4]
16141614
: ConstantPointerNull::get(cast<PointerType>(
16151615
ConstOps[3]->getType()));
1616+
if (DeactivationSymbol->getType()->isPointerTy())
1617+
return error(
1618+
"ptrauth deactivation symbol operand must be a pointer");
16161619

16171620
C = ConstantPtrAuth::get(ConstOps[0], Key, Disc, ConstOps[3],
16181621
DeactivationSymbol);

llvm/lib/IR/Verifier.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2632,6 +2632,9 @@ void Verifier::visitConstantPtrAuth(const ConstantPtrAuth *CPA) {
26322632
Check(CPA->getDiscriminator()->getBitWidth() == 64,
26332633
"signed ptrauth constant discriminator must be i64 constant integer");
26342634

2635+
Check(CPA->getDeactivationSymbol()->getType()->isPointerTy(),
2636+
"signed ptrauth constant deactivation symbol must be a pointer");
2637+
26352638
Check(isa<GlobalValue>(CPA->getDeactivationSymbol()) ||
26362639
CPA->getDeactivationSymbol()->isNullValue(),
26372640
"signed ptrauth constant deactivation symbol must be a global value "

0 commit comments

Comments
 (0)