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 | b0a9ffaeb0cb3802da3611b95d3ea7f49f03f787 (patch) | |
tree | 09342d4ef97079bea1bd8f69762d7a3145813d43 | |
parent | 165a7a925d73286abfc826b3d6339843b02c09e0 (diff) | |
download | external_llvm-b0a9ffaeb0cb3802da3611b95d3ea7f49f03f787.zip external_llvm-b0a9ffaeb0cb3802da3611b95d3ea7f49f03f787.tar.gz external_llvm-b0a9ffaeb0cb3802da3611b95d3ea7f49f03f787.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185031 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Option/Option.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Option/Option.cpp b/lib/Option/Option.cpp index 0e22634..f1b7941 100644 --- a/lib/Option/Option.cpp +++ b/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() << '"'; |