Skip to content

Commit 9046acb

Browse files
committed
Ignore labels before the first instruction
1 parent 06b037e commit 9046acb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bolt/lib/Passes/PAuthGadgetScanner.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,10 @@ class NoCFGPacRetAnalysis : public PacRetAnalysis {
544544
MCInst &Inst = I.second;
545545

546546
// If there is a label before this instruction, it is possible that it
547-
// can be jumped-to, thus conservatively resetting S.
548-
if (BF.hasLabelAt(I.first))
547+
// can be jumped-to, thus conservatively resetting S. As an exception,
548+
// let's ignore any labels at the beginning of the function, as at least
549+
// one label is expected there.
550+
if (BF.hasLabelAt(I.first) && &Inst != &BF.instrs().begin()->second)
549551
S = createUnsafeState();
550552

551553
// Check if we need to remove an old annotation (this is the case if

0 commit comments

Comments
 (0)