summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cfi-verify/lib/GraphBuilder.cpp
diff options
context:
space:
mode:
authorMitch Phillips <mitchphillips@outlook.com>2017-11-15 00:35:26 +0000
committerMitch Phillips <mitchphillips@outlook.com>2017-11-15 00:35:26 +0000
commit2e7be2a65af2ffdd7ce378b54d16b9e3859ff3b5 (patch)
tree81b21cf2d236a2e280911bfab0de1ca6dbbb7443 /llvm/tools/llvm-cfi-verify/lib/GraphBuilder.cpp
parentbf6495fbcbc29527c799d320d1f36a256798a095 (diff)
downloadbcm5719-llvm-2e7be2a65af2ffdd7ce378b54d16b9e3859ff3b5.tar.gz
bcm5719-llvm-2e7be2a65af2ffdd7ce378b54d16b9e3859ff3b5.zip
[cfi-verify] Validate there are no register clobbers between CFI-check and instruction execution.
Summary: This patch adds another failure mode for `validateCFIProtection(..)`, wherein any register that affects the indirect control flow instruction is clobbered to between the CFI-check and the instruction's execution. Also includes a modification to make MCInstrDesc::hasDefOfPhysReg public. Reviewers: vlad.tsyrklevich Reviewed By: vlad.tsyrklevich Subscribers: llvm-commits, pcc, kcc Differential Revision: https://reviews.llvm.org/D39820 llvm-svn: 318238
Diffstat (limited to 'llvm/tools/llvm-cfi-verify/lib/GraphBuilder.cpp')
-rw-r--r--llvm/tools/llvm-cfi-verify/lib/GraphBuilder.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/tools/llvm-cfi-verify/lib/GraphBuilder.cpp b/llvm/tools/llvm-cfi-verify/lib/GraphBuilder.cpp
index ff921713302..65d4b99af20 100644
--- a/llvm/tools/llvm-cfi-verify/lib/GraphBuilder.cpp
+++ b/llvm/tools/llvm-cfi-verify/lib/GraphBuilder.cpp
@@ -301,6 +301,7 @@ void GraphBuilder::buildFlowGraphImpl(const FileAnalysis &Analysis,
BranchNode.Target = 0;
BranchNode.Fallthrough = 0;
BranchNode.CFIProtection = false;
+ BranchNode.IndirectCFIsOnTargetPath = (BranchTarget == Address);
if (BranchTarget == Address)
BranchNode.Target = Address;
OpenPOWER on IntegriCloud