diff options
author | Filipe Cabecinhas <me@filcab.net> | 2015-11-03 13:48:21 +0000 |
---|---|---|
committer | Filipe Cabecinhas <me@filcab.net> | 2015-11-03 13:48:21 +0000 |
commit | f3e167af4b714487982208cb4b94218cdfbb75c1 (patch) | |
tree | 46e8181db1ed102e520143257e8b79258ff051f5 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | de212f15899f2bd1a247d425a4edc846235aea37 (diff) | |
download | bcm5719-llvm-f3e167af4b714487982208cb4b94218cdfbb75c1.tar.gz bcm5719-llvm-f3e167af4b714487982208cb4b94218cdfbb75c1.zip |
Don't use Twine objects after their lifetimes end.
No test, since it would depend on what the compiler can optimize/reuse.
My next commit made this bug visible on Linux Release compiles with some
versions of gcc.
llvm-svn: 251909
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 4b8b554b252..74a5553ce6e 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -526,19 +526,19 @@ static std::error_code error(DiagnosticHandlerFunction DiagnosticHandler, std::error_code BitcodeReader::error(BitcodeError E, const Twine &Message) { if (!ProducerIdentification.empty()) { - Twine MsgWithID = Message + " (Producer: '" + ProducerIdentification + - "' Reader: 'LLVM " + LLVM_VERSION_STRING "')"; - return ::error(DiagnosticHandler, make_error_code(E), MsgWithID); + return ::error(DiagnosticHandler, make_error_code(E), + Message + " (Producer: '" + ProducerIdentification + + "' Reader: 'LLVM " + LLVM_VERSION_STRING "')"); } return ::error(DiagnosticHandler, make_error_code(E), Message); } std::error_code BitcodeReader::error(const Twine &Message) { if (!ProducerIdentification.empty()) { - Twine MsgWithID = Message + " (Producer: '" + ProducerIdentification + - "' Reader: 'LLVM " + LLVM_VERSION_STRING "')"; return ::error(DiagnosticHandler, - make_error_code(BitcodeError::CorruptedBitcode), MsgWithID); + make_error_code(BitcodeError::CorruptedBitcode), + Message + " (Producer: '" + ProducerIdentification + + "' Reader: 'LLVM " + LLVM_VERSION_STRING "')"); } return ::error(DiagnosticHandler, make_error_code(BitcodeError::CorruptedBitcode), Message); |