Fix assert when propagate inlines was enabled.

This commit is contained in:
Bartosz Taudul 2024-03-31 18:44:01 +02:00
parent 30f1b901a9
commit 651c6c5350
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -5590,6 +5590,16 @@ const std::vector<uint64_t>* SourceView::GetAddressesForLocation( uint32_t fileS
}
else
{
// In some cases debug data can be nonsense, assigning an inline function to the same line as the parent.
// The specific example is in TracySysTrace.cpp:1150, which has the following local stack trace:
// 1. RingBuffer::Enable() TracySysTrace.cpp:1150
// 2. SysTraceWorker() TracySysTrace.cpp:1150
// RingBuffer::Enable() is in TracyRingBuffer.hpp:74, and this line is assigned to the remaining asm lines
// generated by this inline function. But for some reason, the parent call site is assigned for the first
// asm line, that should be assigned to the inline function itself.
// Workaround this by checking if the asm line address is already in the list.
if( lit->second.back() == op.addr ) continue;
assert( lit->second.back() < op.addr );
lit->second.emplace_back( op.addr );
}