]> granicus.if.org Git - llvm/commitdiff
[cfi-verify] Added a simple check that stops division-by-zero error when no indirect...
authorMitch Phillips <mitchphillips@outlook.com>
Mon, 6 Nov 2017 19:14:09 +0000 (19:14 +0000)
committerMitch Phillips <mitchphillips@outlook.com>
Mon, 6 Nov 2017 19:14:09 +0000 (19:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317500 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-cfi-verify/llvm-cfi-verify.cpp

index a3c202f53bbc002254137c22e48f8838d47f347b..3b4a5c155d04334b577b51590ea0e11bc3c8551d 100644 (file)
@@ -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"