@@ -640,12 +640,19 @@ class MCPlusBuilder {
640
640
// / it may be important for the compiler to check the address explicitly not
641
641
// / to introduce a signing or authentication oracle.
642
642
// /
643
- // / If this function returns a (Reg, Inst) pair and before execution of Inst
643
+ // / This function is intended to detect a complex, multi-instruction pointer-
644
+ // / checking sequence spanning a contiguous range of instructions at the end
645
+ // / of the basic block (as these sequences are expected to end with a
646
+ // / conditional branch - this is how they are implemented on AArch64 by LLVM).
647
+ // / If a (Reg, FirstInst) pair is returned and before execution of FirstInst
644
648
// / Reg was last written to by an authentication instruction, then it is known
645
649
// / that in any successor of BB either
646
650
// / * the authentication instruction that last wrote to Reg succeeded, or
647
651
// / * the program is terminated abnormally without introducing any signing
648
652
// / or authentication oracles
653
+ // /
654
+ // / Note that this function is not expected to repeat the results returned
655
+ // / by getAuthCheckedReg(Inst, MayOverwrite) function below.
649
656
virtual std::optional<std::pair<MCPhysReg, MCInst *>>
650
657
getAuthCheckedReg (BinaryBasicBlock &BB) const {
651
658
llvm_unreachable (" not implemented" );
@@ -660,6 +667,9 @@ class MCPlusBuilder {
660
667
// /
661
668
// / Additionally, if MayOverwrite is false, it is known that the authenticated
662
669
// / pointer is not clobbered by Inst itself.
670
+ // /
671
+ // / Use this function for simple, single-instruction patterns instead of
672
+ // / its getAuthCheckedReg(BB) counterpart.
663
673
virtual MCPhysReg getAuthCheckedReg (const MCInst &Inst,
664
674
bool MayOverwrite) const {
665
675
llvm_unreachable (" not implemented" );
0 commit comments