summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cfi-verify/llvm-cfi-verify.cpp
diff options
context:
space:
mode:
authorMitch Phillips <mitchphillips@outlook.com>2017-11-06 19:14:09 +0000
committerMitch Phillips <mitchphillips@outlook.com>2017-11-06 19:14:09 +0000
commit6fb3525113b32af5201f2005f0618877783b8430 (patch)
tree1ead3df19eaba0e091689fe02622ce4bceee17c8 /llvm/tools/llvm-cfi-verify/llvm-cfi-verify.cpp
parente3b8d9a312bf5eb02808763a4b265c4a77952e25 (diff)
downloadbcm5719-llvm-6fb3525113b32af5201f2005f0618877783b8430.tar.gz
bcm5719-llvm-6fb3525113b32af5201f2005f0618877783b8430.zip
[cfi-verify] Added a simple check that stops division-by-zero error when no indirect CF instructions are found in the provided file.
llvm-svn: 317500
Diffstat (limited to 'llvm/tools/llvm-cfi-verify/llvm-cfi-verify.cpp')
-rw-r--r--llvm/tools/llvm-cfi-verify/llvm-cfi-verify.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/tools/llvm-cfi-verify/llvm-cfi-verify.cpp b/llvm/tools/llvm-cfi-verify/llvm-cfi-verify.cpp
index a3c202f53bb..3b4a5c155d0 100644
--- a/llvm/tools/llvm-cfi-verify/llvm-cfi-verify.cpp
+++ b/llvm/tools/llvm-cfi-verify/llvm-cfi-verify.cpp
@@ -132,8 +132,10 @@ void printIndirectCFInstructions(FileAnalysis &Analysis,
uint64_t IndirectCFInstructions = ExpectedProtected + UnexpectedProtected +
ExpectedUnprotected + UnexpectedUnprotected;
- if (IndirectCFInstructions == 0)
+ if (IndirectCFInstructions == 0) {
outs() << "No indirect CF instructions found.\n";
+ return;
+ }
outs() << formatv("Expected Protected: {0} ({1:P})\n"
"Unexpected Protected: {2} ({3:P})\n"
OpenPOWER on IntegriCloud