diff options
author | Michael Ilseman <milseman@apple.com> | 2014-12-11 19:46:38 +0000 |
---|---|---|
committer | Michael Ilseman <milseman@apple.com> | 2014-12-11 19:46:38 +0000 |
commit | 4e654cd66451354b84cac12b1fc0321a451519d6 (patch) | |
tree | e51b1605cd6e6a1afcb35f8879dd54f8154f721b /llvm/lib/Support/CommandLine.cpp | |
parent | 199aeff7dd4b970d41371d6ec5f753b2f5d28576 (diff) | |
download | bcm5719-llvm-4e654cd66451354b84cac12b1fc0321a451519d6.tar.gz bcm5719-llvm-4e654cd66451354b84cac12b1fc0321a451519d6.zip |
Silence static analyzer warnings in LLVMSupport.
The static analyzer catches a few potential bugs in LLVMSupport. Add
in asserts to silence the warnings.
llvm-svn: 224044
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r-- | llvm/lib/Support/CommandLine.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index 985c8777701..7b06219104e 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/lib/Support/CommandLine.cpp @@ -323,6 +323,7 @@ static inline bool ProvideOption(Option *Handler, StringRef ArgName, if (i+1 >= argc) return Handler->error("requires a value!"); // Steal the next argument, like for '-o filename' + assert(argv && "null check"); Value = argv[++i]; } break; @@ -356,6 +357,7 @@ static inline bool ProvideOption(Option *Handler, StringRef ArgName, while (NumAdditionalVals > 0) { if (i+1 >= argc) return Handler->error("not enough values!"); + assert(argv && "null check"); Value = argv[++i]; if (CommaSeparateAndAddOccurrence(Handler, i, ArgName, Value, MultiArg)) |