OSDN Git Service

Fix stack-use-after-scope in test previously hidden by -fmerge-all-constants
authorVitaly Buka <vitalybuka@google.com>
Sat, 7 Apr 2018 09:46:00 +0000 (09:46 +0000)
committerVitaly Buka <vitalybuka@google.com>
Sat, 7 Apr 2018 09:46:00 +0000 (09:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329489 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/Support/CommandLineTest.cpp

index 328dfa3..8657504 100644 (file)
@@ -96,9 +96,9 @@ cl::OptionCategory TestCategory("Test Options", "Description");
 TEST(CommandLineTest, ModifyExisitingOption) {
   StackOption<int> TestOption("test-option", cl::desc("old description"));
 
-  const char Description[] = "New description";
-  const char ArgString[] = "new-test-option";
-  const char ValueString[] = "Integer";
+  static const char Description[] = "New description";
+  static const char ArgString[] = "new-test-option";
+  static const char ValueString[] = "Integer";
 
   StringMap<cl::Option *> &Map =
       cl::getRegisteredOptions(*cl::TopLevelSubCommand);