diff options
author | Andrew Trick <atrick@apple.com> | 2011-09-08 05:25:49 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2011-09-08 05:25:49 +0000 |
commit | 43674ad44d5865c3dfb879a3ea6b579c85b57567 (patch) | |
tree | bf5dcff2e791af19befd12d5796b633070cb98bd /llvm/utils/TableGen/FixedLenDecoderEmitter.cpp | |
parent | 61abca6daa9cf1cdb2e577ca89dfb86ca2b9ed50 (diff) | |
download | bcm5719-llvm-43674ad44d5865c3dfb879a3ea6b579c85b57567.tar.gz bcm5719-llvm-43674ad44d5865c3dfb879a3ea6b579c85b57567.zip |
Fix a use of freed string contents.
Speculatively try to fix our windows testers with a patch I found on the internet.
llvm-svn: 139279
Diffstat (limited to 'llvm/utils/TableGen/FixedLenDecoderEmitter.cpp')
-rw-r--r-- | llvm/utils/TableGen/FixedLenDecoderEmitter.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp b/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp index c0b51385b1a..85f3dbfa5f6 100644 --- a/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp +++ b/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp @@ -764,11 +764,11 @@ void FilterChooser::emitBinaryParser(raw_ostream &o, unsigned &Indentation, static void emitSinglePredicateMatch(raw_ostream &o, StringRef str, std::string PredicateNamespace) { - const char *X = str.str().c_str(); - if (X[0] == '!') - o << "!(Bits & " << PredicateNamespace << "::" << &X[1] << ")"; + if (str[0] == '!') + o << "!(Bits & " << PredicateNamespace << "::" + << str.slice(1,str.size()) << ")"; else - o << "(Bits & " << PredicateNamespace << "::" << X << ")"; + o << "(Bits & " << PredicateNamespace << "::" << str << ")"; } bool FilterChooser::emitPredicateMatch(raw_ostream &o, unsigned &Indentation, |