diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-01-30 06:19:27 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-01-30 06:19:27 +0000 |
commit | 0dd6b9b9744d99ec53f6be961d0714f64f380327 (patch) | |
tree | ed4538420061c41e1f2a9c8b593367ba8f96dacd /tools | |
parent | a2a6c3911debf0499ac8658b56844de261e42050 (diff) | |
download | llvm-0dd6b9b9744d99ec53f6be961d0714f64f380327.tar.gz llvm-0dd6b9b9744d99ec53f6be961d0714f64f380327.tar.bz2 llvm-0dd6b9b9744d99ec53f6be961d0714f64f380327.tar.xz |
tools: fix Twine abuse
utohexstr provides a temporary string, making it unsafe to use with the Twine
interface which will not copy the string. Switch to using std::string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200457 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llvm-readobj/ARMAttributeParser.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/llvm-readobj/ARMAttributeParser.cpp b/tools/llvm-readobj/ARMAttributeParser.cpp index 26b8f6e91a..5857547be7 100644 --- a/tools/llvm-readobj/ARMAttributeParser.cpp +++ b/tools/llvm-readobj/ARMAttributeParser.cpp @@ -317,16 +317,16 @@ void ARMAttributeParser::ABI_align_needed(AttrType Tag, const uint8_t *Data, uint64_t Value = ParseInteger(Data, Offset); - Twine Description; + std::string Description; if (Value < countof(Strings)) - Description = StringRef(Strings[Value]); + Description = std::string(Strings[Value]); else if (Value <= 12) - Description = Twine("8-byte alignment, ") + utostr(1 << Value) - + Twine("-byte extended alignment"); + Description = std::string("8-byte alignment, ") + utostr(1 << Value) + + std::string("-byte extended alignment"); else Description = "Invalid"; - PrintAttribute(Tag, Value, Description.str()); + PrintAttribute(Tag, Value, Description); } void ARMAttributeParser::ABI_align_preserved(AttrType Tag, const uint8_t *Data, @@ -338,16 +338,16 @@ void ARMAttributeParser::ABI_align_preserved(AttrType Tag, const uint8_t *Data, uint64_t Value = ParseInteger(Data, Offset); - Twine Description; + std::string Description; if (Value < countof(Strings)) - Description = StringRef(Strings[Value]); + Description = std::string(Strings[Value]); else if (Value <= 12) - Description = Twine("8-byte stack alignment, ") + utostr(1 << Value) - + Twine("-byte data alignment"); + Description = std::string("8-byte stack alignment, ") + utostr(1 << Value) + + std::string("-byte data alignment"); else Description = "Invalid"; - PrintAttribute(Tag, Value, Description.str()); + PrintAttribute(Tag, Value, Description); } void ARMAttributeParser::ABI_enum_size(AttrType Tag, const uint8_t *Data, |