diff options
| author | Reid Kleckner <reid@kleckner.net> | 2013-06-26 22:43:37 +0000 |
|---|---|---|
| committer | Reid Kleckner <reid@kleckner.net> | 2013-06-26 22:43:37 +0000 |
| commit | 7b78d359fbad5fa8a42367916e037d83c23c5f78 (patch) | |
| tree | 6a338c581c084c737f8ce298816afa4ecd88e4b3 /llvm/lib/Option/Option.cpp | |
| parent | fc5eb5e264682eabe47aa6cfdd972c1803361e4c (diff) | |
| download | bcm5719-llvm-7b78d359fbad5fa8a42367916e037d83c23c5f78.tar.gz bcm5719-llvm-7b78d359fbad5fa8a42367916e037d83c23c5f78.zip | |
Fix a crash bug in dumping options with groups
Option groups don't have prefixes. Option dumping is basically dead
code unless there is something wrong with the option table, so this
isn't an important crasher.
llvm-svn: 185031
Diffstat (limited to 'llvm/lib/Option/Option.cpp')
| -rw-r--r-- | llvm/lib/Option/Option.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Option/Option.cpp b/llvm/lib/Option/Option.cpp index 0e2263475e0..f1b7941e498 100644 --- a/llvm/lib/Option/Option.cpp +++ b/llvm/lib/Option/Option.cpp @@ -50,11 +50,13 @@ void Option::dump() const { #undef P } - llvm::errs() << " Prefixes:["; - for (const char * const *Pre = Info->Prefixes; *Pre != 0; ++Pre) { - llvm::errs() << '"' << *Pre << (*(Pre + 1) == 0 ? "\"" : "\", "); + if (Info->Prefixes) { + llvm::errs() << " Prefixes:["; + for (const char * const *Pre = Info->Prefixes; *Pre != 0; ++Pre) { + llvm::errs() << '"' << *Pre << (*(Pre + 1) == 0 ? "\"" : "\", "); + } + llvm::errs() << ']'; } - llvm::errs() << ']'; llvm::errs() << " Name:\"" << getName() << '"'; |

