[llvm-commits] [llvm] r98349 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Benjamin Kramer
benny.kra at googlemail.com
Fri Mar 12 05:54:59 PST 2010
Author: d0k
Date: Fri Mar 12 07:54:59 2010
New Revision: 98349
URL: http://llvm.org/viewvc/llvm-project?rev=98349&view=rev
Log:
Use StringRef::substr instead of std::string::substr to avoid using a free'd
string temporary. This should fix PR6590.
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=98349&r1=98348&r2=98349&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Fri Mar 12 07:54:59 2010
@@ -9837,7 +9837,8 @@
AsmPieces[2] == "${0:w}" &&
IA->getConstraintString().compare(0, 5, "=r,0,") == 0) {
AsmPieces.clear();
- SplitString(IA->getConstraintString().substr(5), AsmPieces, ",");
+ const std::string &Constraints = IA->getConstraintString();
+ SplitString(StringRef(Constraints).substr(5), AsmPieces, ",");
std::sort(AsmPieces.begin(), AsmPieces.end());
if (AsmPieces.size() == 4 &&
AsmPieces[0] == "~{cc}" &&
More information about the llvm-commits
mailing list