[llvm] r335423 - [llc] Fix sanitizer failure.

Jonas Devlieghere via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 23 12:04:10 PDT 2018


Author: jdevlieghere
Date: Sat Jun 23 12:04:10 2018
New Revision: 335423

URL: http://llvm.org/viewvc/llvm-project?rev=335423&view=rev
Log:
[llc] Fix sanitizer failure.

Store the string on the stack rather than just the StringRef.

Fix sanitizer bots:

  http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/19948
  http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-msan/builds/5500

Modified:
    llvm/trunk/tools/llc/llc.cpp

Modified: llvm/trunk/tools/llc/llc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llc/llc.cpp?rev=335423&r1=335422&r2=335423&view=diff
==============================================================================
--- llvm/trunk/tools/llc/llc.cpp (original)
+++ llvm/trunk/tools/llc/llc.cpp Sat Jun 23 12:04:10 2018
@@ -504,7 +504,7 @@ static int compileModule(char **argv, LL
   // Verify module immediately to catch problems before doInitialization() is
   // called on any passes.
   if (!NoVerify && verifyModule(*M, &errs())) {
-    StringRef Prefix =
+    std::string Prefix =
         (Twine(argv[0]) + Twine(": ") + Twine(InputFilename)).str();
     WithColor::error(errs(), Prefix) << "input module is broken!\n";
     return 1;




More information about the llvm-commits mailing list