mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Fix crash when loading a trace with unresolved strings.
Unresolved strings ("???") are not saved, but the internal string pointers are saved. Resolving such string pointers caused a crash.
This commit is contained in:
parent
9342ba0e71
commit
793e955480
@ -392,7 +392,11 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
|
|||||||
{
|
{
|
||||||
uint64_t id, ptr;
|
uint64_t id, ptr;
|
||||||
f.Read2( id, ptr );
|
f.Read2( id, ptr );
|
||||||
m_data.strings.emplace( id, pointerMap.find( ptr )->second );
|
auto it = pointerMap.find( ptr );
|
||||||
|
if( it != pointerMap.end() )
|
||||||
|
{
|
||||||
|
m_data.strings.emplace( id, it->second );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
f.Read( sz );
|
f.Read( sz );
|
||||||
@ -400,7 +404,11 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
|
|||||||
{
|
{
|
||||||
uint64_t id, ptr;
|
uint64_t id, ptr;
|
||||||
f.Read2( id, ptr );
|
f.Read2( id, ptr );
|
||||||
m_data.threadNames.emplace( id, pointerMap.find( ptr )->second );
|
auto it = pointerMap.find( ptr );
|
||||||
|
if( it != pointerMap.end() )
|
||||||
|
{
|
||||||
|
m_data.threadNames.emplace( id, it->second );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( fileVer >= FileVersion( 0, 3, 201 ) )
|
if( fileVer >= FileVersion( 0, 3, 201 ) )
|
||||||
|
Loading…
Reference in New Issue
Block a user