Skip to content

Commit 0ab5d47

Browse files
committed
[CodeGen][AArch64] ptrauth intrinsic to safely construct relative pointer for swift coroutines
A ptrauth intrinsic for swift co-routine support that allows creation of signed pointer from offset stored at address relative to the pointer. Following C-like pseudo code (ignoring keys,discriminators) explains its operation: let rawptr = PACauth(inputptr); return PACsign( rawptr + *(int32*)(rawptr+addend) ) What: Authenticate a signed pointer, load a 32bit value at offset 'addend' from pointer, add this value to pointer, sign this new pointer. builtin: __builtin_ptrauth_auth_load_relative_and_sign intrinsic: ptrauth_auth_resign_load_relative note: conflicts resolved llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp due to upstream change in args for emitPtrauthAuthResign
1 parent b3b36d3 commit 0ab5d47

File tree

14 files changed

+808
-21
lines changed

14 files changed

+808
-21
lines changed

clang/include/clang/Basic/Builtins.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4655,6 +4655,12 @@ def PtrauthAuthAndResign : Builtin {
46554655
let Prototype = "void*(void*,int,void*,int,void*)";
46564656
}
46574657

4658+
def PtrauthAuthLoadRelativeAndSign : Builtin {
4659+
let Spellings = ["__builtin_ptrauth_auth_load_relative_and_sign"];
4660+
let Attributes = [CustomTypeChecking, NoThrow];
4661+
let Prototype = "void*(void*,int,void*,int,void*,ptrdiff_t)";
4662+
}
4663+
46584664
def PtrauthAuth : Builtin {
46594665
let Spellings = ["__builtin_ptrauth_auth"];
46604666
let Attributes = [CustomTypeChecking, NoThrow];

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11097,6 +11097,8 @@ def err_builtin_requires_language : Error<"'%0' is only available in %1">;
1109711097

1109811098
def err_constant_integer_arg_type : Error<
1109911099
"argument to %0 must be a constant integer">;
11100+
def err_constant_integer_last_arg_type
11101+
: Error<"last argument to %0 must be a constant integer">;
1110011102

1110111103
def ext_mixed_decls_code : Extension<
1110211104
"mixing declarations and code is a C99 extension">,

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5601,12 +5601,13 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
56015601

56025602
case Builtin::BI__builtin_ptrauth_auth:
56035603
case Builtin::BI__builtin_ptrauth_auth_and_resign:
5604+
case Builtin::BI__builtin_ptrauth_auth_load_relative_and_sign:
56045605
case Builtin::BI__builtin_ptrauth_blend_discriminator:
56055606
case Builtin::BI__builtin_ptrauth_sign_generic_data:
56065607
case Builtin::BI__builtin_ptrauth_sign_unauthenticated:
56075608
case Builtin::BI__builtin_ptrauth_strip: {
56085609
// Emit the arguments.
5609-
SmallVector<llvm::Value *, 5> Args;
5610+
SmallVector<llvm::Value *, 6> Args;
56105611
for (auto argExpr : E->arguments())
56115612
Args.push_back(EmitScalarExpr(argExpr));
56125613

@@ -5617,6 +5618,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
56175618

56185619
switch (BuiltinID) {
56195620
case Builtin::BI__builtin_ptrauth_auth_and_resign:
5621+
case Builtin::BI__builtin_ptrauth_auth_load_relative_and_sign:
56205622
if (Args[4]->getType()->isPointerTy())
56215623
Args[4] = Builder.CreatePtrToInt(Args[4], IntPtrTy);
56225624
[[fallthrough]];
@@ -5644,6 +5646,8 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
56445646
return Intrinsic::ptrauth_auth;
56455647
case Builtin::BI__builtin_ptrauth_auth_and_resign:
56465648
return Intrinsic::ptrauth_resign;
5649+
case Builtin::BI__builtin_ptrauth_auth_load_relative_and_sign:
5650+
return Intrinsic::ptrauth_resign_load_relative;
56475651
case Builtin::BI__builtin_ptrauth_blend_discriminator:
56485652
return Intrinsic::ptrauth_blend;
56495653
case Builtin::BI__builtin_ptrauth_sign_generic_data:

clang/lib/Headers/ptrauth.h

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,31 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;
178178
__builtin_ptrauth_auth_and_resign(__value, __old_key, __old_data, __new_key, \
179179
__new_data)
180180

181+
/* Authenticate a pointer using one scheme, load 32bit value at offset addend
182+
from the pointer, and add this value to the pointer, sign using specified
183+
scheme.
184+
185+
If the result is subsequently authenticated using the new scheme, that
186+
authentication is guaranteed to fail if and only if the initial
187+
authentication failed.
188+
189+
The value must be an expression of pointer type.
190+
The key must be a constant expression of type ptrauth_key.
191+
The extra data must be an expression of pointer or integer type;
192+
if an integer, it will be coerced to ptrauth_extra_data_t.
193+
The addend must be an immediate ptrdiff_t value.
194+
The result will have the same type as the original value.
195+
196+
This operation is guaranteed to not leave the intermediate value
197+
available for attack before it is re-signed.
198+
199+
Do not pass a null pointer to this function. A null pointer
200+
will not successfully authenticate. */
201+
#define ptrauth_auth_load_relative_and_sign(__value, __old_key, __old_data, \
202+
__new_key, __new_data, __addend) \
203+
__builtin_ptrauth_auth_load_relative_and_sign( \
204+
__value, __old_key, __old_data, __new_key, __new_data, __addend)
205+
181206
/* Authenticate a pointer using one scheme and resign it as a C
182207
function pointer.
183208
@@ -351,6 +376,17 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;
351376
__value; \
352377
})
353378

379+
#define ptrauth_auth_load_relative_and_sign(__value, __old_key, __old_data, \
380+
__new_key, __new_data, __addend) \
381+
({ \
382+
(void)__old_key; \
383+
(void)__old_data; \
384+
(void)__new_key; \
385+
(void)__new_data; \
386+
const char *__value_tmp = (const char *)(__value); \
387+
(void *)(__value_tmp + *(const int *)(__value_tmp + (__addend))); \
388+
})
389+
354390
#define ptrauth_auth_function(__value, __old_key, __old_data) \
355391
({ \
356392
(void)__old_key; \
@@ -380,7 +416,6 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;
380416
((ptrauth_generic_signature_t)0); \
381417
})
382418

383-
384419
#define ptrauth_cxx_vtable_pointer(key, address_discrimination, \
385420
extra_discrimination...)
386421

clang/lib/Sema/SemaChecking.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,6 +1814,32 @@ static ExprResult PointerAuthAuthAndResign(Sema &S, CallExpr *Call) {
18141814
return Call;
18151815
}
18161816

1817+
static ExprResult PointerAuthAuthLoadRelativeAndSign(Sema &S, CallExpr *Call) {
1818+
if (S.checkArgCount(Call, 6))
1819+
return ExprError();
1820+
if (checkPointerAuthEnabled(S, Call))
1821+
return ExprError();
1822+
const Expr *AddendExpr = Call->getArg(5);
1823+
bool AddendIsConstInt = AddendExpr->isIntegerConstantExpr(S.Context);
1824+
if (!AddendIsConstInt) {
1825+
const Expr *Arg = Call->getArg(5)->IgnoreParenImpCasts();
1826+
DeclRefExpr *DRE = cast<DeclRefExpr>(Call->getCallee()->IgnoreParenCasts());
1827+
FunctionDecl *FDecl = cast<FunctionDecl>(DRE->getDecl());
1828+
S.Diag(Arg->getBeginLoc(), diag::err_constant_integer_last_arg_type)
1829+
<< FDecl->getDeclName() << Arg->getSourceRange();
1830+
}
1831+
if (checkPointerAuthValue(S, Call->getArgs()[0], PAO_Auth) ||
1832+
checkPointerAuthKey(S, Call->getArgs()[1]) ||
1833+
checkPointerAuthValue(S, Call->getArgs()[2], PAO_Discriminator) ||
1834+
checkPointerAuthKey(S, Call->getArgs()[3]) ||
1835+
checkPointerAuthValue(S, Call->getArgs()[4], PAO_Discriminator) ||
1836+
!AddendIsConstInt)
1837+
return ExprError();
1838+
1839+
Call->setType(Call->getArgs()[0]->getType());
1840+
return Call;
1841+
}
1842+
18171843
static ExprResult PointerAuthStringDiscriminator(Sema &S, CallExpr *Call) {
18181844
if (checkPointerAuthEnabled(S, Call))
18191845
return ExprError();
@@ -2866,6 +2892,8 @@ Sema::CheckBuiltinFunctionCall(FunctionDecl *FDecl, unsigned BuiltinID,
28662892
return PointerAuthSignGenericData(*this, TheCall);
28672893
case Builtin::BI__builtin_ptrauth_auth_and_resign:
28682894
return PointerAuthAuthAndResign(*this, TheCall);
2895+
case Builtin::BI__builtin_ptrauth_auth_load_relative_and_sign:
2896+
return PointerAuthAuthLoadRelativeAndSign(*this, TheCall);
28692897
case Builtin::BI__builtin_ptrauth_string_discriminator:
28702898
return PointerAuthStringDiscriminator(*this, TheCall);
28712899

clang/test/CodeGen/ptrauth-intrinsics.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@ void test_auth_and_resign() {
5555
fnptr = __builtin_ptrauth_auth_and_resign(fnptr, 0, ptr_discriminator, 3, 15);
5656
}
5757

58+
// CHECK-LABEL: define {{.*}}void @test_auth_load_relative_and_sign()
59+
void test_auth_load_relative_and_sign() {
60+
// CHECK: [[PTR:%.*]] = load ptr, ptr @fnptr,
61+
// CHECK-NEXT: [[DISC0:%.*]] = load ptr, ptr @ptr_discriminator,
62+
// CHECK-NEXT: [[T0:%.*]] = ptrtoint ptr [[PTR]] to i64
63+
// CHECK-NEXT: [[DISC:%.*]] = ptrtoint ptr [[DISC0]] to i64
64+
// CHECK-NEXT: [[T1:%.*]] = call i64 @llvm.ptrauth.resign.load.relative(i64 [[T0]], i32 0, i64 [[DISC]], i32 3, i64 15, i64 16)
65+
// CHECK-NEXT: [[RESULT:%.*]] = inttoptr i64 [[T1]] to ptr
66+
// CHECK-NEXT: store ptr [[RESULT]], ptr @fnptr,
67+
fnptr = __builtin_ptrauth_auth_load_relative_and_sign(fnptr, 0, ptr_discriminator, 3, 15, 16L);
68+
}
69+
5870
// CHECK-LABEL: define {{.*}}void @test_blend_discriminator()
5971
void test_blend_discriminator() {
6072
// CHECK: [[PTR:%.*]] = load ptr, ptr @fnptr,

clang/test/Sema/ptrauth.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,29 @@ void test_auth_and_resign(int *dp, int (*fp)(int)) {
121121

122122
float *mismatch = __builtin_ptrauth_auth_and_resign(dp, VALID_DATA_KEY, 0, VALID_DATA_KEY, dp); // expected-warning {{incompatible pointer types initializing 'float *' with an expression of type 'int *'}}
123123
}
124+
void test_auth_load_relative_and_sign(int *dp, int (*fp)(int)) {
125+
__builtin_ptrauth_auth_load_relative_and_sign(dp, VALID_DATA_KEY, 0, VALID_DATA_KEY, 0); // expected-error {{too few arguments}}
126+
__builtin_ptrauth_auth_load_relative_and_sign(dp, VALID_DATA_KEY, dp, VALID_DATA_KEY, dp, 0, 0); // expected-error {{too many arguments}}
127+
int n = *dp;
128+
__builtin_ptrauth_auth_load_relative_and_sign(dp, VALID_DATA_KEY, dp, VALID_DATA_KEY, dp,n); // expected-error {{last argument to '__builtin_ptrauth_auth_load_relative_and_sign' must be a constant integer}}
129+
__builtin_ptrauth_auth_load_relative_and_sign(mismatched_type, VALID_DATA_KEY, 0, VALID_DATA_KEY, dp, 0); // expected-error {{signed value must have pointer type; type here is 'struct A'}}
130+
__builtin_ptrauth_auth_load_relative_and_sign(dp, mismatched_type, 0, VALID_DATA_KEY, dp, 0); // expected-error {{passing 'struct A' to parameter of incompatible type 'int'}}
131+
__builtin_ptrauth_auth_load_relative_and_sign(dp, VALID_DATA_KEY, mismatched_type, VALID_DATA_KEY, dp, 0); // expected-error {{extra discriminator must have pointer or integer type; type here is 'struct A'}}
132+
__builtin_ptrauth_auth_load_relative_and_sign(dp, VALID_DATA_KEY, 0, mismatched_type, dp, 0); // expected-error {{passing 'struct A' to parameter of incompatible type 'int'}}
133+
__builtin_ptrauth_auth_load_relative_and_sign(dp, VALID_DATA_KEY, 0, VALID_DATA_KEY, mismatched_type, 0); // expected-error {{extra discriminator must have pointer or integer type; type here is 'struct A'}}
134+
135+
(void) __builtin_ptrauth_auth_and_resign(NULL, VALID_DATA_KEY, 0, VALID_DATA_KEY, dp); // expected-warning {{authenticating a null pointer will almost certainly trap}}
136+
137+
int *dr = __builtin_ptrauth_auth_load_relative_and_sign(dp, VALID_DATA_KEY, 0, VALID_DATA_KEY, dp, 10);
138+
dr = __builtin_ptrauth_auth_load_relative_and_sign(dp, INVALID_KEY, 0, VALID_DATA_KEY, dp, 10); // expected-error {{does not identify a valid pointer authentication key for the current target}}
139+
dr = __builtin_ptrauth_auth_load_relative_and_sign(dp, VALID_DATA_KEY, 0, INVALID_KEY, dp, 10); // expected-error {{does not identify a valid pointer authentication key for the current target}}
140+
141+
int (*fr)(int) = __builtin_ptrauth_auth_load_relative_and_sign(fp, VALID_CODE_KEY, 0, VALID_CODE_KEY, dp, 10);
142+
fr = __builtin_ptrauth_auth_load_relative_and_sign(fp, INVALID_KEY, 0, VALID_CODE_KEY, dp, 10); // expected-error {{does not identify a valid pointer authentication key for the current target}}
143+
fr = __builtin_ptrauth_auth_load_relative_and_sign(fp, VALID_CODE_KEY, 0, INVALID_KEY, dp, 10); // expected-error {{does not identify a valid pointer authentication key for the current target}}
144+
145+
float *mismatch = __builtin_ptrauth_auth_load_relative_and_sign(dp, VALID_DATA_KEY, 0, VALID_DATA_KEY, dp,0); // expected-warning {{incompatible pointer types initializing 'float *' with an expression of type 'int *'}}
146+
}
124147

125148
void test_sign_generic_data(int *dp) {
126149
__builtin_ptrauth_sign_generic_data(dp); // expected-error {{too few arguments}}

llvm/include/llvm/IR/Intrinsics.td

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2818,6 +2818,19 @@ def int_ptrauth_resign : Intrinsic<[llvm_i64_ty],
28182818
[IntrNoMem, ImmArg<ArgIndex<1>>,
28192819
ImmArg<ArgIndex<3>>]>;
28202820

2821+
// Authenticate a signed pointer, load 32bit value at offset from pointer, add
2822+
// both, and sign it. The second (key) and third (discriminator) arguments
2823+
// specify the signing schema used for authenticating. The fourth and fifth
2824+
// arguments specify the schema used for signing. The sixth argument is addend
2825+
// added to pointer to load the relative offset. The signature must be valid.
2826+
// This is a combined form of int_ptrauth_resign for relative pointers
2827+
def int_ptrauth_resign_load_relative
2828+
: Intrinsic<[llvm_i64_ty],
2829+
[llvm_i64_ty, llvm_i32_ty, llvm_i64_ty, llvm_i32_ty,
2830+
llvm_i64_ty, llvm_i64_ty],
2831+
[IntrReadMem, ImmArg<ArgIndex<1>>, ImmArg<ArgIndex<3>>,
2832+
ImmArg<ArgIndex<5>>]>;
2833+
28212834
// Strip the embedded signature out of a signed pointer.
28222835
// The second argument specifies the key.
28232836
// This behaves like @llvm.ptrauth.auth, but doesn't require the signature to

llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp

Lines changed: 83 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,14 @@ class AArch64AsmPrinter : public AsmPrinter {
168168
// Check authenticated LR before tail calling.
169169
void emitPtrauthTailCallHardening(const MachineInstr *TC);
170170

171-
// Emit the sequence for AUT or AUTPAC.
171+
// Emit the sequence for AUT or AUTPAC. Addend if AUTRELLOADPAC
172172
void emitPtrauthAuthResign(Register AUTVal, AArch64PACKey::ID AUTKey,
173173
uint64_t AUTDisc,
174174
const MachineOperand *AUTAddrDisc,
175175
Register Scratch,
176176
std::optional<AArch64PACKey::ID> PACKey,
177-
uint64_t PACDisc, Register PACAddrDisc);
177+
uint64_t PACDisc, Register PACAddrDisc,
178+
std::optional<uint64_t> Addend);
178179

179180
// Emit the sequence for PAC.
180181
void emitPtrauthSign(const MachineInstr *MI);
@@ -2078,9 +2079,9 @@ void AArch64AsmPrinter::emitPtrauthAuthResign(
20782079
Register AUTVal, AArch64PACKey::ID AUTKey, uint64_t AUTDisc,
20792080
const MachineOperand *AUTAddrDisc, Register Scratch,
20802081
std::optional<AArch64PACKey::ID> PACKey, uint64_t PACDisc,
2081-
Register PACAddrDisc) {
2082+
Register PACAddrDisc, std::optional<uint64_t> OptAddend) {
20822083
const bool IsAUTPAC = PACKey.has_value();
2083-
2084+
const bool HasLoad = OptAddend.has_value();
20842085
// We expand AUT/AUTPAC into a sequence of the form
20852086
//
20862087
// ; authenticate x16
@@ -2151,12 +2152,76 @@ void AArch64AsmPrinter::emitPtrauthAuthResign(
21512152
}
21522153

21532154
// We already emitted unchecked and checked-but-non-trapping AUTs.
2154-
// That left us with trapping AUTs, and AUTPACs.
2155+
// That left us with trapping AUTs, and AUTPA/AUTRELLOADPACs.
21552156
// Trapping AUTs don't need PAC: we're done.
21562157
if (!IsAUTPAC)
21572158
return;
21582159

2159-
// Compute pac discriminator
2160+
if (HasLoad) {
2161+
int64_t Addend = *OptAddend;
2162+
// incoming rawpointer in X16, X17 is not live at this point.
2163+
// LDSRWpre x17, x16, simm9 ; note: x16+simm9 used later.
2164+
if (isInt<9>(Addend)) {
2165+
EmitToStreamer(*OutStreamer, MCInstBuilder(AArch64::LDRSWpre)
2166+
.addReg(AArch64::X16)
2167+
.addReg(AArch64::X17)
2168+
.addReg(AArch64::X16)
2169+
.addImm(/*simm9:*/ Addend));
2170+
} else {
2171+
// x16 = x16 + Addend computation has 2 variants
2172+
if (isUInt<24>(Addend)) {
2173+
// variant 1: add x16, x16, Addend >> shift12 ls shift12
2174+
// This can take upto 2 instructions.
2175+
for (int BitPos = 0; BitPos != 24 && (Addend >> BitPos); BitPos += 12) {
2176+
EmitToStreamer(*OutStreamer, MCInstBuilder(AArch64::ADDXri)
2177+
.addReg(AArch64::X16)
2178+
.addReg(AArch64::X16)
2179+
.addImm((Addend >> BitPos) & 0xfff)
2180+
.addImm(AArch64_AM::getShifterImm(
2181+
AArch64_AM::LSL, BitPos)));
2182+
}
2183+
} else {
2184+
// variant 2: accumulate constant in X17 16 bits at a time, and add to
2185+
// X16 This can take 2-5 instructions.
2186+
EmitToStreamer(*OutStreamer, MCInstBuilder(AArch64::MOVZXi)
2187+
.addReg(AArch64::X17)
2188+
.addImm(Addend & 0xffff)
2189+
.addImm(AArch64_AM::getShifterImm(
2190+
AArch64_AM::LSL, 0)));
2191+
2192+
for (int Offset = 16; Offset < 64; Offset += 16) {
2193+
uint16_t Fragment = static_cast<uint16_t>(Addend >> Offset);
2194+
if (!Fragment)
2195+
continue;
2196+
EmitToStreamer(*OutStreamer, MCInstBuilder(AArch64::MOVKXi)
2197+
.addReg(AArch64::X17)
2198+
.addReg(AArch64::X17)
2199+
.addImm(Fragment)
2200+
.addImm(/*shift:*/ Offset));
2201+
}
2202+
// addx x16, x16, x17
2203+
EmitToStreamer(*OutStreamer, MCInstBuilder(AArch64::ADDXrs)
2204+
.addReg(AArch64::X16)
2205+
.addReg(AArch64::X16)
2206+
.addReg(AArch64::X17)
2207+
.addImm(0));
2208+
}
2209+
// ldrsw x17,x16(0)
2210+
EmitToStreamer(*OutStreamer, MCInstBuilder(AArch64::LDRSWui)
2211+
.addReg(AArch64::X17)
2212+
.addReg(AArch64::X16)
2213+
.addImm(0));
2214+
}
2215+
// addx x16, x16, x17
2216+
EmitToStreamer(*OutStreamer, MCInstBuilder(AArch64::ADDXrs)
2217+
.addReg(AArch64::X16)
2218+
.addReg(AArch64::X16)
2219+
.addReg(AArch64::X17)
2220+
.addImm(0));
2221+
2222+
} /* HasLoad == true */
2223+
2224+
// Compute pac discriminator into x17
21602225
assert(isUInt<16>(PACDisc));
21612226
Register PACDiscReg =
21622227
emitPtrauthDiscriminator(PACDisc, PACAddrDisc, Scratch);
@@ -2906,22 +2971,31 @@ void AArch64AsmPrinter::emitInstruction(const MachineInstr *MI) {
29062971
emitPtrauthAuthResign(AArch64::X16,
29072972
(AArch64PACKey::ID)MI->getOperand(0).getImm(),
29082973
MI->getOperand(1).getImm(), &MI->getOperand(2),
2909-
AArch64::X17, std::nullopt, 0, 0);
2974+
AArch64::X17, std::nullopt, 0, 0, std::nullopt);
29102975
return;
29112976

29122977
case AArch64::AUTxMxN:
29132978
emitPtrauthAuthResign(MI->getOperand(0).getReg(),
29142979
(AArch64PACKey::ID)MI->getOperand(3).getImm(),
29152980
MI->getOperand(4).getImm(), &MI->getOperand(5),
2916-
MI->getOperand(1).getReg(), std::nullopt, 0, 0);
2981+
MI->getOperand(1).getReg(), std::nullopt, 0, 0,
2982+
std::nullopt);
29172983
return;
29182984

2985+
case AArch64::AUTRELLOADPAC:
2986+
emitPtrauthAuthResign(
2987+
AArch64::X16, (AArch64PACKey::ID)MI->getOperand(0).getImm(),
2988+
MI->getOperand(1).getImm(), &MI->getOperand(2), AArch64::X17,
2989+
(AArch64PACKey::ID)MI->getOperand(3).getImm(),
2990+
MI->getOperand(4).getImm(), MI->getOperand(5).getReg(),
2991+
MI->getOperand(6).getImm());
2992+
return;
29192993
case AArch64::AUTPAC:
29202994
emitPtrauthAuthResign(
29212995
AArch64::X16, (AArch64PACKey::ID)MI->getOperand(0).getImm(),
29222996
MI->getOperand(1).getImm(), &MI->getOperand(2), AArch64::X17,
29232997
(AArch64PACKey::ID)MI->getOperand(3).getImm(),
2924-
MI->getOperand(4).getImm(), MI->getOperand(5).getReg());
2998+
MI->getOperand(4).getImm(), MI->getOperand(5).getReg(), std::nullopt);
29252999
return;
29263000

29273001
case AArch64::PAC:

0 commit comments

Comments
 (0)