From 4fe6a8c826bd963ed87a1b98490ed87755e34201 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Fri, 23 Dec 2016 23:55:26 +0000 Subject: Add an assertion for cl::opt names: they can't start with '-' llvm-svn: 290467 --- llvm/lib/Support/CommandLine.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'llvm/lib/Support/CommandLine.cpp') diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index fa1782c9941..0a989706b43 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/lib/Support/CommandLine.cpp @@ -373,6 +373,7 @@ void Option::removeArgument() { GlobalParser->removeOption(this); } void Option::setArgStr(StringRef S) { if (FullyInitialized) GlobalParser->updateArgStr(this, S); + assert(S[0] != '-' && "Option can't start with '-"); ArgStr = S; } -- cgit v1.2.3