]> granicus.if.org Git - clang/commitdiff
Driver: CCC_ADD_ARGS could end up using dangling pointers.
authorDaniel Dunbar <daniel@zuster.org>
Fri, 10 Apr 2009 18:32:59 +0000 (18:32 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 10 Apr 2009 18:32:59 +0000 (18:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68805 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Driver.cpp
tools/driver/driver.cpp

index f9a82ff78d437e0de429b768c9087ed594fabe9f..8768629625dafab516026dc943c0294288a53a5f 100644 (file)
@@ -109,8 +109,6 @@ Compilation *Driver::BuildCompilation(int argc, const char **argv) {
 
   // FIXME: What are we going to do with -V and -b?
 
-  // FIXME: Handle CCC_ADD_ARGS.
-
   // FIXME: This stuff needs to go into the Compilation, not the
   // driver.
   bool CCCPrintOptions = false, CCCPrintActions = false;
index 3c75bb0d185ff97672d6201aa63c5b48d4265e9d..94fcf7cc567eedc7e1136ca3cd9bcfb9efb75097 100644 (file)
@@ -86,8 +86,8 @@ int main(int argc, const char **argv) {
   llvm::OwningPtr<Compilation> C;
 
   // Handle CCC_ADD_ARGS, a comma separated list of extra arguments.
+  std::set<std::string> SavedStrings;
   if (const char *Cur = ::getenv("CCC_ADD_ARGS")) {
-    std::set<std::string> SavedStrings;
     std::vector<const char*> StringPointers;
 
     // FIXME: Driver shouldn't take extra initial argument.