diff options
| author | Dan Gohman <gohman@apple.com> | 2010-08-13 23:56:28 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-08-13 23:56:28 +0000 |
| commit | 6ab8bc1829c9d24dc8f8672a736c6dabbdaf493d (patch) | |
| tree | fc275839d66e6fdcdeaaf96f37461ece02831f1d /lib | |
| parent | 616d081f189e70a1277f6534f6a2c7d621c1685a (diff) | |
| download | external_llvm-6ab8bc1829c9d24dc8f8672a736c6dabbdaf493d.zip external_llvm-6ab8bc1829c9d24dc8f8672a736c6dabbdaf493d.tar.gz external_llvm-6ab8bc1829c9d24dc8f8672a736c6dabbdaf493d.tar.bz2 | |
Add a lint check for an indirectbr destination which has not
had its address taken.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111058 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Analysis/Lint.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Analysis/Lint.cpp b/lib/Analysis/Lint.cpp index a9d9724..5f1cb61 100644 --- a/lib/Analysis/Lint.cpp +++ b/lib/Analysis/Lint.cpp @@ -521,6 +521,12 @@ void Lint::visitIndirectBrInst(IndirectBrInst &I) { Assert1(I.getNumDestinations() != 0, "Undefined behavior: indirectbr with no destinations", &I); + + for (unsigned i = 0, e = I.getNumDestinations(); i != e; ++i) + Assert1(I.getDestination(i)->hasAddressTaken(), + "Unusual: indirectbr destination has not " + "had its address taken", + &I); } void Lint::visitExtractElementInst(ExtractElementInst &I) { |
