Skip to content

Commit 9b657a2

Browse files
Make a copy of assembly path. (#93238)
* Make a copy of assembly path.
1 parent f20b2b5 commit 9b657a2

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/coreclr/vm/perfinfo.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ void PerfInfo::LogImage(PEAssembly* pPEAssembly, CHAR* guid)
3232
PRECONDITION(guid != nullptr);
3333
} CONTRACTL_END;
3434

35-
SString value;
36-
const SString& path = pPEAssembly->GetPath();
35+
// Nothing to log if the assembly path isn't present.
36+
SString path{ pPEAssembly->GetPath() };
3737
if (path.IsEmpty())
3838
{
3939
return;
@@ -49,12 +49,11 @@ void PerfInfo::LogImage(PEAssembly* pPEAssembly, CHAR* guid)
4949
}
5050
}
5151

52+
SString value;
5253
value.Printf("%s%c%s%c%p", path.GetUTF8(), sDelimiter, guid, sDelimiter, baseAddr);
5354

54-
SString command;
55-
command.Printf("%s", "ImageLoad");
55+
SString command{ SString::Literal, "ImageLoad" };
5656
WriteLine(command, value);
57-
5857
}
5958

6059
// Writes a command line, with "type" being the type of command, with "value" as the command's corresponding instructions/values. This is to be used to log specific information, e.g. LogImage

0 commit comments

Comments
 (0)