From: Daniel Sanders Date: Fri, 13 Oct 2017 21:51:20 +0000 (+0000) Subject: [globalisel][tablegen] Fix a use-after free bug that manifests on non-macOS machines. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c9676b5d356572b27936fb24d9d5f13688a7710a;p=llvm [globalisel][tablegen] Fix a use-after free bug that manifests on non-macOS machines. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315765 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/TableGen/GlobalISelEmitter.cpp b/utils/TableGen/GlobalISelEmitter.cpp index 2e86b17d0b9..71a2b2c3f21 100644 --- a/utils/TableGen/GlobalISelEmitter.cpp +++ b/utils/TableGen/GlobalISelEmitter.cpp @@ -2628,7 +2628,7 @@ void GlobalISelEmitter::emitImmPredicates( 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()