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
This commit is contained in:
Vince Harron 2015-02-18 23:16:51 +00:00
parent ef1df9ec73
commit e837626173
1 changed files with 1 additions and 1 deletions

View File

@ -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());