From c4ae8e903c6abd7e391e8a16f8e850073342ca4d Mon Sep 17 00:00:00 2001 From: Tanya Lattner Date: Sat, 20 Nov 2004 23:35:20 +0000 Subject: [PATCH] Fixed assertion from triggering. We need to check if the commandline map is empty before checking if an arg exists. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18057 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/CommandLine.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp index 5abeb8d2ef1..9ae4cde1b21 100644 --- a/lib/Support/CommandLine.cpp +++ b/lib/Support/CommandLine.cpp @@ -80,6 +80,8 @@ static void AddArgument(const char *ArgName, Option *Opt) { // options have already been processed and the map has been deleted! // static void RemoveArgument(const char *ArgName, Option *Opt) { + if(getOpts().empty()) return; + #ifndef NDEBUG // This disgusting HACK is brought to you courtesy of GCC 3.3.2, which ICE's // If we pass ArgName directly into getOption here.