[llvm] r315765 - [globalisel][tablegen] Fix a use-after free bug that manifests on non-macOS machines.

Daniel Sanders via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 13 14:51:20 PDT 2017


Author: dsanders
Date: Fri Oct 13 14:51:20 2017
New Revision: 315765

URL: http://llvm.org/viewvc/llvm-project?rev=315765&view=rev
Log:
[globalisel][tablegen] Fix a use-after free bug that manifests on non-macOS machines.


Modified:
    llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp

Modified: llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp?rev=315765&r1=315764&r2=315765&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp Fri Oct 13 14:51:20 2017
@@ -2628,7 +2628,7 @@ void GlobalISelEmitter::emitImmPredicate
   if (!MatchedRecords.empty()) {
     OS << "// PatFrag predicates.\n"
        << "enum {\n";
-    StringRef EnumeratorSeparator =
+    std::string EnumeratorSeparator =
         (" = GIPFP_" + TypeIdentifier + "_Invalid + 1,\n").str();
     for (const auto *Record : MatchedRecords) {
       OS << "  GIPFP_" << TypeIdentifier << "_Predicate_" << Record->getName()




More information about the llvm-commits mailing list