mirror of
https://github.com/wolfpld/tracy.git
synced 2026-08-29 14:38:21 +00:00
Fix possible div-by-zero.
If as.ipMaxAsm.local is 0 and m_childCalls is false, GetHotnessColor(count, 0) performs float(2 * count) / 0. The old code explicitly guarded against this with the as.ipMaxAsm.local != 0 check.
This commit is contained in:
@@ -2775,7 +2775,7 @@ uint64_t SourceView::RenderSymbolAsmView( const AddrStatData& as, Worker& worker
|
||||
const auto x60 = round( rect.Min.x + rect.GetWidth() * 0.6f );
|
||||
for( size_t i=0; i<buckets.size(); i++ )
|
||||
{
|
||||
if( buckets[i] < 0 ) continue;
|
||||
if( buckets[i] <= 0 ) continue;
|
||||
const auto y0 = round( rect.Min.y + float( i ) / bucketNum * rect.GetHeight() );
|
||||
const auto y1 = round( rect.Min.y + float( i + 1 ) / bucketNum * rect.GetHeight() );
|
||||
const auto color = GetHotnessColor( buckets[i], m_childCalls ? (as.ipMaxAsm.local + as.ipMaxAsm.ext) : as.ipMaxAsm.local );
|
||||
|
||||
Reference in New Issue
Block a user