Skip to content

Commit 776d64e

Browse files
committed
[𝘀𝗽𝗿] changes introduced through rebase
Created using spr 1.3.6-beta.1 [skip ci]
1 parent 1c166ca commit 776d64e

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

llvm/docs/LangRef.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3092,13 +3092,16 @@ A "convergencectrl" operand bundle is only valid on a ``convergent`` operation.
30923092
When present, the operand bundle must contain exactly one value of token type.
30933093
See the :doc:`ConvergentOperations` document for details.
30943094

3095+
.. _deactivationsymbol:
3096+
30953097
Deactivation Symbol Operand Bundles
30963098
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30973099

30983100
A ``"deactivation-symbol"`` operand bundle is valid on the following
30993101
instructions (AArch64 only):
31003102

3101-
- Call to a normal function with ``notail`` attribute.
3103+
- Call to a normal function with ``notail`` attribute and a first argument and
3104+
return value of type ``ptr``.
31023105
- Call to ``llvm.ptrauth.sign`` or ``llvm.ptrauth.auth`` intrinsics.
31033106

31043107
This operand bundle specifies that if the deactivation symbol is defined
@@ -5148,7 +5151,7 @@ need to refer to the actual function body.
51485151
Pointer Authentication Constants
51495152
--------------------------------
51505153

5151-
``ptrauth (ptr CST, i32 KEY[, i64 DISC[, ptr ADDRDISC]?]?)``
5154+
``ptrauth (ptr CST, i32 KEY[, i64 DISC[, ptr ADDRDISC[, ptr DS]?]?]?)``
51525155

51535156
A '``ptrauth``' constant represents a pointer with a cryptographic
51545157
authentication signature embedded into some bits, as described in the
@@ -5177,6 +5180,11 @@ Otherwise, the expression is equivalent to:
51775180
%tmp2 = call i64 @llvm.ptrauth.sign(i64 ptrtoint (ptr CST to i64), i32 KEY, i64 %tmp1)
51785181
%val = inttoptr i64 %tmp2 to ptr
51795182

5183+
If the deactivation symbol operand ``DS`` has a non-null value,
5184+
the semantics are as if a :ref:`deactivation-symbol operand bundle
5185+
<deactivationsymbol>` were added to the ``llvm.ptrauth.sign`` intrinsic
5186+
calls above, with ``DS`` as the only operand.
5187+
51805188
.. _constantexprs:
51815189

51825190
Constant Expressions

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)