Skip to content

Commit e67962a

Browse files
committed
Add deactivation symbol operand to ConstantPtrAuth.
Deactivation symbol operands are supported in the code generator by building on the previously added support for IRELATIVE relocations. TODO: - Fix broken test. - Add bitcode and IR writer support. - Add tests. Pull Request: llvm#133537
1 parent f87901d commit e67962a

File tree

16 files changed

+126
-41
lines changed

16 files changed

+126
-41
lines changed

clang/lib/CodeGen/CGPointerAuth.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,9 @@ CodeGenModule::getConstantSignedPointer(llvm::Constant *Pointer, unsigned Key,
440440
IntegerDiscriminator = llvm::ConstantInt::get(Int64Ty, 0);
441441
}
442442

443-
return llvm::ConstantPtrAuth::get(Pointer,
444-
llvm::ConstantInt::get(Int32Ty, Key),
445-
IntegerDiscriminator, AddressDiscriminator);
443+
return llvm::ConstantPtrAuth::get(
444+
Pointer, llvm::ConstantInt::get(Int32Ty, Key), IntegerDiscriminator,
445+
AddressDiscriminator, llvm::Constant::getNullValue(UnqualPtrTy));
446446
}
447447

448448
/// Does a given PointerAuthScheme require us to sign a value

llvm/include/llvm/Bitcode/LLVMBitCodes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ enum ConstantsCodes {
437437
CST_CODE_CE_GEP_WITH_INRANGE = 31, // [opty, flags, range, n x operands]
438438
CST_CODE_CE_GEP = 32, // [opty, flags, n x operands]
439439
CST_CODE_PTRAUTH = 33, // [ptr, key, disc, addrdisc]
440+
CST_CODE_PTRAUTH2 = 34, // [ptr, key, disc, addrdisc, DeactivationSymbol]
440441
};
441442

442443
/// CastOpcodes - These are values used in the bitcode files to encode which

llvm/include/llvm/IR/Constants.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,10 +1031,10 @@ class ConstantPtrAuth final : public Constant {
10311031
friend struct ConstantPtrAuthKeyType;
10321032
friend class Constant;
10331033

1034-
constexpr static IntrusiveOperandsAllocMarker AllocMarker{4};
1034+
constexpr static IntrusiveOperandsAllocMarker AllocMarker{5};
10351035

10361036
ConstantPtrAuth(Constant *Ptr, ConstantInt *Key, ConstantInt *Disc,
1037-
Constant *AddrDisc);
1037+
Constant *AddrDisc, Constant *DeactivationSymbol);
10381038

10391039
void *operator new(size_t s) { return User::operator new(s, AllocMarker); }
10401040

@@ -1044,7 +1044,8 @@ class ConstantPtrAuth final : public Constant {
10441044
public:
10451045
/// Return a pointer signed with the specified parameters.
10461046
static ConstantPtrAuth *get(Constant *Ptr, ConstantInt *Key,
1047-
ConstantInt *Disc, Constant *AddrDisc);
1047+
ConstantInt *Disc, Constant *AddrDisc,
1048+
Constant *DeactivationSymbol);
10481049

10491050
/// Produce a new ptrauth expression signing the given value using
10501051
/// the same schema as is stored in one.
@@ -1076,6 +1077,10 @@ class ConstantPtrAuth final : public Constant {
10761077
return !getAddrDiscriminator()->isNullValue();
10771078
}
10781079

1080+
Constant *getDeactivationSymbol() const {
1081+
return cast<Constant>(Op<4>().get());
1082+
}
1083+
10791084
/// A constant value for the address discriminator which has special
10801085
/// significance to ctors/dtors lowering. Regular address discrimination can't
10811086
/// be applied for them since uses of llvm.global_{c|d}tors are disallowed
@@ -1103,7 +1108,7 @@ class ConstantPtrAuth final : public Constant {
11031108

11041109
template <>
11051110
struct OperandTraits<ConstantPtrAuth>
1106-
: public FixedNumOperandTraits<ConstantPtrAuth, 4> {};
1111+
: public FixedNumOperandTraits<ConstantPtrAuth, 5> {};
11071112

11081113
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ConstantPtrAuth, Constant)
11091114

llvm/include/llvm/SandboxIR/Constant.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,8 @@ class ConstantPtrAuth final : public Constant {
13841384
public:
13851385
/// Return a pointer signed with the specified parameters.
13861386
static ConstantPtrAuth *get(Constant *Ptr, ConstantInt *Key,
1387-
ConstantInt *Disc, Constant *AddrDisc);
1387+
ConstantInt *Disc, Constant *AddrDisc,
1388+
Constant *DeactivationSymbol);
13881389
/// The pointer that is signed in this ptrauth signed pointer.
13891390
Constant *getPointer() const;
13901391

@@ -1399,6 +1400,8 @@ class ConstantPtrAuth final : public Constant {
13991400
/// the only global-initializer user of the ptrauth signed pointer.
14001401
Constant *getAddrDiscriminator() const;
14011402

1403+
Constant *getDeactivationSymbol() const;
1404+
14021405
/// Whether there is any non-null address discriminator.
14031406
bool hasAddressDiscriminator() const {
14041407
return cast<llvm::ConstantPtrAuth>(Val)->hasAddressDiscriminator();

llvm/lib/AsmParser/LLParser.cpp

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4218,11 +4218,12 @@ bool LLParser::parseValID(ValID &ID, PerFunctionState *PFS, Type *ExpectedTy) {
42184218
}
42194219
case lltok::kw_ptrauth: {
42204220
// ValID ::= 'ptrauth' '(' ptr @foo ',' i32 <key>
4221-
// (',' i64 <disc> (',' ptr addrdisc)? )? ')'
4221+
// (',' i64 <disc> (',' ptr addrdisc (',' ptr ds)? )? )? ')'
42224222
Lex.Lex();
42234223

42244224
Constant *Ptr, *Key;
4225-
Constant *Disc = nullptr, *AddrDisc = nullptr;
4225+
Constant *Disc = nullptr, *AddrDisc = nullptr,
4226+
*DeactivationSymbol = nullptr;
42264227

42274228
if (parseToken(lltok::lparen,
42284229
"expected '(' in constant ptrauth expression") ||
@@ -4231,11 +4232,14 @@ bool LLParser::parseValID(ValID &ID, PerFunctionState *PFS, Type *ExpectedTy) {
42314232
"expected comma in constant ptrauth expression") ||
42324233
parseGlobalTypeAndValue(Key))
42334234
return true;
4234-
// If present, parse the optional disc/addrdisc.
4235-
if (EatIfPresent(lltok::comma))
4236-
if (parseGlobalTypeAndValue(Disc) ||
4237-
(EatIfPresent(lltok::comma) && parseGlobalTypeAndValue(AddrDisc)))
4238-
return true;
4235+
// If present, parse the optional disc/addrdisc/ds.
4236+
if (EatIfPresent(lltok::comma) && parseGlobalTypeAndValue(Disc))
4237+
return true;
4238+
if (EatIfPresent(lltok::comma) && parseGlobalTypeAndValue(AddrDisc))
4239+
return true;
4240+
if (EatIfPresent(lltok::comma) &&
4241+
parseGlobalTypeAndValue(DeactivationSymbol))
4242+
return true;
42394243
if (parseToken(lltok::rparen,
42404244
"expected ')' in constant ptrauth expression"))
42414245
return true;
@@ -4266,7 +4270,16 @@ bool LLParser::parseValID(ValID &ID, PerFunctionState *PFS, Type *ExpectedTy) {
42664270
AddrDisc = ConstantPointerNull::get(PointerType::get(Context, 0));
42674271
}
42684272

4269-
ID.ConstantVal = ConstantPtrAuth::get(Ptr, KeyC, DiscC, AddrDisc);
4273+
if (DeactivationSymbol) {
4274+
if (!DeactivationSymbol->getType()->isPointerTy())
4275+
return error(
4276+
ID.Loc, "constant ptrauth deactivation symbol must be a pointer");
4277+
} else {
4278+
DeactivationSymbol = ConstantPointerNull::get(PointerType::get(Context, 0));
4279+
}
4280+
4281+
ID.ConstantVal =
4282+
ConstantPtrAuth::get(Ptr, KeyC, DiscC, AddrDisc, DeactivationSymbol);
42704283
ID.Kind = ValID::t_Constant;
42714284
return false;
42724285
}

llvm/lib/Bitcode/Reader/BitcodeReader.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1603,7 +1603,13 @@ Expected<Value *> BitcodeReader::materializeValue(unsigned StartValID,
16031603
if (!Disc)
16041604
return error("ptrauth disc operand must be ConstantInt");
16051605

1606-
C = ConstantPtrAuth::get(ConstOps[0], Key, Disc, ConstOps[3]);
1606+
auto *DeactivationSymbol =
1607+
ConstOps.size() > 4 ? ConstOps[4]
1608+
: ConstantPointerNull::get(cast<PointerType>(
1609+
ConstOps[3]->getType()));
1610+
1611+
C = ConstantPtrAuth::get(ConstOps[0], Key, Disc, ConstOps[3],
1612+
DeactivationSymbol);
16071613
break;
16081614
}
16091615
case BitcodeConstant::NoCFIOpcode: {
@@ -3801,6 +3807,16 @@ Error BitcodeReader::parseConstants() {
38013807
(unsigned)Record[2], (unsigned)Record[3]});
38023808
break;
38033809
}
3810+
case bitc::CST_CODE_PTRAUTH2: {
3811+
if (Record.size() < 4)
3812+
return error("Invalid ptrauth record");
3813+
// Ptr, Key, Disc, AddrDisc, DeactivationSymbol
3814+
V = BitcodeConstant::create(
3815+
Alloc, CurTy, BitcodeConstant::ConstantPtrAuthOpcode,
3816+
{(unsigned)Record[0], (unsigned)Record[1], (unsigned)Record[2],
3817+
(unsigned)Record[3], (unsigned)Record[4]});
3818+
break;
3819+
}
38043820
}
38053821

38063822
assert(V->getType() == getTypeByID(CurTyID) && "Incorrect result type ID");

llvm/lib/IR/AsmWriter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1658,12 +1658,14 @@ static void WriteConstantInternal(raw_ostream &Out, const Constant *CV,
16581658
if (const ConstantPtrAuth *CPA = dyn_cast<ConstantPtrAuth>(CV)) {
16591659
Out << "ptrauth (";
16601660

1661-
// ptrauth (ptr CST, i32 KEY[, i64 DISC[, ptr ADDRDISC]?]?)
1661+
// ptrauth (ptr CST, i32 KEY[, i64 DISC[, ptr ADDRDISC[, ptr DS]?]?]?)
16621662
unsigned NumOpsToWrite = 2;
16631663
if (!CPA->getOperand(2)->isNullValue())
16641664
NumOpsToWrite = 3;
16651665
if (!CPA->getOperand(3)->isNullValue())
16661666
NumOpsToWrite = 4;
1667+
if (!CPA->getOperand(4)->isNullValue())
1668+
NumOpsToWrite = 5;
16671669

16681670
ListSeparator LS;
16691671
for (unsigned i = 0, e = NumOpsToWrite; i != e; ++i) {

llvm/lib/IR/Constants.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,19 +2056,22 @@ Value *NoCFIValue::handleOperandChangeImpl(Value *From, Value *To) {
20562056
//
20572057

20582058
ConstantPtrAuth *ConstantPtrAuth::get(Constant *Ptr, ConstantInt *Key,
2059-
ConstantInt *Disc, Constant *AddrDisc) {
2060-
Constant *ArgVec[] = {Ptr, Key, Disc, AddrDisc};
2059+
ConstantInt *Disc, Constant *AddrDisc,
2060+
Constant *DeactivationSymbol) {
2061+
Constant *ArgVec[] = {Ptr, Key, Disc, AddrDisc, DeactivationSymbol};
20612062
ConstantPtrAuthKeyType MapKey(ArgVec);
20622063
LLVMContextImpl *pImpl = Ptr->getContext().pImpl;
20632064
return pImpl->ConstantPtrAuths.getOrCreate(Ptr->getType(), MapKey);
20642065
}
20652066

20662067
ConstantPtrAuth *ConstantPtrAuth::getWithSameSchema(Constant *Pointer) const {
2067-
return get(Pointer, getKey(), getDiscriminator(), getAddrDiscriminator());
2068+
return get(Pointer, getKey(), getDiscriminator(), getAddrDiscriminator(),
2069+
getDeactivationSymbol());
20682070
}
20692071

20702072
ConstantPtrAuth::ConstantPtrAuth(Constant *Ptr, ConstantInt *Key,
2071-
ConstantInt *Disc, Constant *AddrDisc)
2073+
ConstantInt *Disc, Constant *AddrDisc,
2074+
Constant *DeactivationSymbol)
20722075
: Constant(Ptr->getType(), Value::ConstantPtrAuthVal, AllocMarker) {
20732076
assert(Ptr->getType()->isPointerTy());
20742077
assert(Key->getBitWidth() == 32);
@@ -2078,6 +2081,7 @@ ConstantPtrAuth::ConstantPtrAuth(Constant *Ptr, ConstantInt *Key,
20782081
setOperand(1, Key);
20792082
setOperand(2, Disc);
20802083
setOperand(3, AddrDisc);
2084+
setOperand(4, DeactivationSymbol);
20812085
}
20822086

20832087
/// Remove the constant from the constant table.

llvm/lib/IR/ConstantsContext.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,8 @@ struct ConstantPtrAuthKeyType {
539539

540540
ConstantPtrAuth *create(TypeClass *Ty) const {
541541
return new ConstantPtrAuth(Operands[0], cast<ConstantInt>(Operands[1]),
542-
cast<ConstantInt>(Operands[2]), Operands[3]);
542+
cast<ConstantInt>(Operands[2]), Operands[3],
543+
Operands[4]);
543544
}
544545
};
545546

llvm/lib/IR/Core.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1699,7 +1699,9 @@ LLVMValueRef LLVMConstantPtrAuth(LLVMValueRef Ptr, LLVMValueRef Key,
16991699
LLVMValueRef Disc, LLVMValueRef AddrDisc) {
17001700
return wrap(ConstantPtrAuth::get(
17011701
unwrap<Constant>(Ptr), unwrap<ConstantInt>(Key),
1702-
unwrap<ConstantInt>(Disc), unwrap<Constant>(AddrDisc)));
1702+
unwrap<ConstantInt>(Disc), unwrap<Constant>(AddrDisc),
1703+
ConstantPointerNull::get(
1704+
cast<PointerType>(unwrap<Constant>(AddrDisc)->getType()))));
17031705
}
17041706

17051707
/*-- Opcode mapping */

llvm/lib/SandboxIR/Constant.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,10 +443,12 @@ PointerType *NoCFIValue::getType() const {
443443
}
444444

445445
ConstantPtrAuth *ConstantPtrAuth::get(Constant *Ptr, ConstantInt *Key,
446-
ConstantInt *Disc, Constant *AddrDisc) {
446+
ConstantInt *Disc, Constant *AddrDisc,
447+
Constant *DeactivationSymbol) {
447448
auto *LLVMC = llvm::ConstantPtrAuth::get(
448449
cast<llvm::Constant>(Ptr->Val), cast<llvm::ConstantInt>(Key->Val),
449-
cast<llvm::ConstantInt>(Disc->Val), cast<llvm::Constant>(AddrDisc->Val));
450+
cast<llvm::ConstantInt>(Disc->Val), cast<llvm::Constant>(AddrDisc->Val),
451+
cast<llvm::Constant>(DeactivationSymbol->Val));
450452
return cast<ConstantPtrAuth>(Ptr->getContext().getOrCreateConstant(LLVMC));
451453
}
452454

@@ -470,6 +472,11 @@ Constant *ConstantPtrAuth::getAddrDiscriminator() const {
470472
cast<llvm::ConstantPtrAuth>(Val)->getAddrDiscriminator());
471473
}
472474

475+
Constant *ConstantPtrAuth::getDeactivationSymbol() const {
476+
return Ctx.getOrCreateConstant(
477+
cast<llvm::ConstantPtrAuth>(Val)->getDeactivationSymbol());
478+
}
479+
473480
ConstantPtrAuth *ConstantPtrAuth::getWithSameSchema(Constant *Pointer) const {
474481
auto *LLVMC = cast<llvm::ConstantPtrAuth>(Val)->getWithSameSchema(
475482
cast<llvm::Constant>(Pointer->Val));

llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ class AArch64AsmPrinter : public AsmPrinter {
218218

219219
const MCExpr *emitPAuthRelocationAsIRelative(
220220
const MCExpr *Target, uint16_t Disc, AArch64PACKey::ID KeyID,
221-
bool HasAddressDiversity, bool IsDSOLocal);
221+
bool HasAddressDiversity, bool IsDSOLocal, const MCExpr *DSExpr);
222222

223223
/// tblgen'erated driver function for lowering simple MI->MC
224224
/// pseudo instructions.
@@ -2301,15 +2301,17 @@ static void emitAddress(MCStreamer &Streamer, MCRegister Reg,
23012301
}
23022302

23032303
static bool targetSupportsPAuthRelocation(const Triple &TT,
2304-
const MCExpr *Target) {
2304+
const MCExpr *Target,
2305+
const MCExpr *DSExpr) {
23052306
// No released version of glibc supports PAuth relocations.
23062307
if (TT.isOSGlibc())
23072308
return false;
23082309

23092310
// We emit PAuth constants as IRELATIVE relocations in cases where the
23102311
// constant cannot be represented as a PAuth relocation:
2311-
// 1) The signed value is not a symbol.
2312-
return !isa<MCConstantExpr>(Target);
2312+
// 1) There is a deactivation symbol.
2313+
// 2) The signed value is not a symbol.
2314+
return !DSExpr && !isa<MCConstantExpr>(Target);
23132315
}
23142316

23152317
static bool targetSupportsIRelativeRelocation(const Triple &TT) {
@@ -2326,7 +2328,7 @@ static bool targetSupportsIRelativeRelocation(const Triple &TT) {
23262328

23272329
const MCExpr *AArch64AsmPrinter::emitPAuthRelocationAsIRelative(
23282330
const MCExpr *Target, uint16_t Disc, AArch64PACKey::ID KeyID,
2329-
bool HasAddressDiversity, bool IsDSOLocal) {
2331+
bool HasAddressDiversity, bool IsDSOLocal, const MCExpr *DSExpr) {
23302332
const Triple &TT = TM.getTargetTriple();
23312333

23322334
// We only emit an IRELATIVE relocation if the target supports IRELATIVE and
@@ -2388,6 +2390,18 @@ const MCExpr *AArch64AsmPrinter::emitPAuthRelocationAsIRelative(
23882390
MCSymbolRefExpr::create(EmuPAC, OutStreamer->getContext());
23892391
OutStreamer->emitInstruction(MCInstBuilder(AArch64::B).addExpr(EmuPACRef),
23902392
*STI);
2393+
2394+
if (DSExpr) {
2395+
auto *PrePACInstExpr =
2396+
MCSymbolRefExpr::create(PrePACInst, OutStreamer->getContext());
2397+
OutStreamer->emitRelocDirective(*PrePACInstExpr, "R_AARCH64_INST32", DSExpr,
2398+
SMLoc(), *STI);
2399+
}
2400+
2401+
// We need a RET despite the above tail call because the deactivation symbol
2402+
// may replace it with a NOP.
2403+
OutStreamer->emitInstruction(MCInstBuilder(AArch64::RET).addReg(AArch64::LR),
2404+
*STI);
23912405
OutStreamer->popSection();
23922406

23932407
return MCSymbolRefExpr::create(IRelativeSym, AArch64MCExpr::VK_FUNCINIT,
@@ -2419,6 +2433,13 @@ AArch64AsmPrinter::lowerConstantPtrAuth(const ConstantPtrAuth &CPA) {
24192433
Sym = MCConstantExpr::create(Offset.getSExtValue(), Ctx);
24202434
}
24212435

2436+
const MCExpr *DSExpr = nullptr;
2437+
if (auto *DS = dyn_cast<GlobalValue>(CPA.getDeactivationSymbol())) {
2438+
if (isa<GlobalAlias>(DS))
2439+
return Sym;
2440+
DSExpr = MCSymbolRefExpr::create(getSymbol(DS), Ctx);
2441+
}
2442+
24222443
uint64_t KeyID = CPA.getKey()->getZExtValue();
24232444
// We later rely on valid KeyID value in AArch64PACKeyIDToString call from
24242445
// AArch64AuthMCExpr::printImpl, so fail fast.
@@ -2435,9 +2456,13 @@ AArch64AsmPrinter::lowerConstantPtrAuth(const ConstantPtrAuth &CPA) {
24352456
// Check if we need to represent this with an IRELATIVE and emit it if so.
24362457
if (auto *IFuncSym = emitPAuthRelocationAsIRelative(
24372458
Sym, Disc, AArch64PACKey::ID(KeyID), CPA.hasAddressDiscriminator(),
2438-
BaseGVB && BaseGVB->isDSOLocal()))
2459+
BaseGVB && BaseGVB->isDSOLocal(), DSExpr))
24392460
return IFuncSym;
24402461

2462+
if (DSExpr)
2463+
report_fatal_error("deactivation symbols unsupported in constant "
2464+
"expressions on this target");
2465+
24412466
// Finally build the complete @AUTH expr.
24422467
return AArch64AuthMCExpr::create(Sym, Disc, AArch64PACKey::ID(KeyID),
24432468
CPA.hasAddressDiscriminator(), Ctx);

llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2979,9 +2979,9 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
29792979
if (NeedSign && isa<ConstantInt>(II->getArgOperand(4))) {
29802980
auto *SignKey = cast<ConstantInt>(II->getArgOperand(3));
29812981
auto *SignDisc = cast<ConstantInt>(II->getArgOperand(4));
2982-
auto *SignAddrDisc = ConstantPointerNull::get(Builder.getPtrTy());
2982+
auto *Null = ConstantPointerNull::get(Builder.getPtrTy());
29832983
auto *NewCPA = ConstantPtrAuth::get(CPA->getPointer(), SignKey,
2984-
SignDisc, SignAddrDisc);
2984+
SignDisc, Null, Null);
29852985
replaceInstUsesWith(
29862986
*II, ConstantExpr::getPointerCast(NewCPA, II->getType()));
29872987
return eraseInstFromFunction(*II);

llvm/lib/Transforms/Utils/ValueMapper.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,8 +527,9 @@ Value *Mapper::mapValue(const Value *V) {
527527
if (isa<ConstantVector>(C))
528528
return getVM()[V] = ConstantVector::get(Ops);
529529
if (isa<ConstantPtrAuth>(C))
530-
return getVM()[V] = ConstantPtrAuth::get(Ops[0], cast<ConstantInt>(Ops[1]),
531-
cast<ConstantInt>(Ops[2]), Ops[3]);
530+
return getVM()[V] =
531+
ConstantPtrAuth::get(Ops[0], cast<ConstantInt>(Ops[1]),
532+
cast<ConstantInt>(Ops[2]), Ops[3], Ops[4]);
532533
// If this is a no-operand constant, it must be because the type was remapped.
533534
if (isa<PoisonValue>(C))
534535
return getVM()[V] = PoisonValue::get(NewTy);

llvm/unittests/SandboxIR/SandboxIRTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1398,7 +1398,7 @@ define ptr @foo() {
13981398
// Check get(), getKey(), getDiscriminator(), getAddrDiscriminator().
13991399
auto *NewPtrAuth = sandboxir::ConstantPtrAuth::get(
14001400
&F, PtrAuth->getKey(), PtrAuth->getDiscriminator(),
1401-
PtrAuth->getAddrDiscriminator());
1401+
PtrAuth->getAddrDiscriminator(), PtrAuth->getDeactivationSymbol());
14021402
EXPECT_EQ(NewPtrAuth, PtrAuth);
14031403
// Check hasAddressDiscriminator().
14041404
EXPECT_EQ(PtrAuth->hasAddressDiscriminator(),

0 commit comments

Comments
 (0)