diff options
author | Vince Harron <vharron@google.com> | 2015-02-18 23:16:51 +0000 |
---|---|---|
committer | Vince Harron <vharron@google.com> | 2015-02-18 23:16:51 +0000 |
commit | e837626173908962a628edf870eb7ea3118a714c (patch) | |
tree | a16ce3c13fea73d77b6e032f75518eddfd0e5411 /lldb/source/Core/FormatEntity.cpp | |
parent | ef1df9ec73622fe3b96306bc892de16f739b6647 (diff) | |
download | bcm5719-llvm-e837626173908962a628edf870eb7ea3118a714c.tar.gz bcm5719-llvm-e837626173908962a628edf870eb7ea3118a714c.zip |
Fix TestDataFormatter* on Linux
llvm::StringRef doesn't make a copy of a string, it just holds a
reference. When special_directions_stream went out of scope,
special_directions was holding on to a stale pointer.
Moving special_directions_stream into a higher scope to keep
special_directions pointing to a valid string.
llvm-svn: 229767
Diffstat (limited to 'lldb/source/Core/FormatEntity.cpp')
-rw-r--r-- | lldb/source/Core/FormatEntity.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Core/FormatEntity.cpp b/lldb/source/Core/FormatEntity.cpp index 98f39982adb..896cd709fed 100644 --- a/lldb/source/Core/FormatEntity.cpp +++ b/lldb/source/Core/FormatEntity.cpp @@ -950,11 +950,11 @@ DumpValue (Stream &s, return false; if (log) log->Printf("[Debugger::FormatPrompt] handle as array"); + StreamString special_directions_stream; llvm::StringRef special_directions; if (close_bracket_index != llvm::StringRef::npos && subpath.size() > close_bracket_index) { ConstString additional_data (subpath.drop_front(close_bracket_index+1)); - StreamString special_directions_stream; special_directions_stream.Printf("${%svar%s", do_deref_pointer ? "*" : "", additional_data.GetCString()); |