mirror of
https://github.com/wolfpld/tracy
synced 2025-04-30 12:53:51 +00:00
Filter invalid jumps.
This commit is contained in:
parent
ea00efa857
commit
421f0895b7
@ -223,18 +223,26 @@ bool SourceView::Disassemble( uint64_t symAddr, const Worker& worker )
|
|||||||
}
|
}
|
||||||
if( jumpAddr >= symAddr && jumpAddr < symAddr + len )
|
if( jumpAddr >= symAddr && jumpAddr < symAddr + len )
|
||||||
{
|
{
|
||||||
const auto min = std::min( jumpAddr, op.address );
|
auto fit = std::lower_bound( insn, insn+cnt, jumpAddr, []( const auto& l, const auto& r ) { return l.address < r; } );
|
||||||
const auto max = std::max( jumpAddr, op.address );
|
if( fit != insn+cnt && fit->address == jumpAddr )
|
||||||
auto it = m_jumpTable.find( jumpAddr );
|
|
||||||
if( it == m_jumpTable.end() )
|
|
||||||
{
|
{
|
||||||
m_jumpTable.emplace( jumpAddr, JumpData { min, max, 0, { op.address } } );
|
const auto min = std::min( jumpAddr, op.address );
|
||||||
|
const auto max = std::max( jumpAddr, op.address );
|
||||||
|
auto it = m_jumpTable.find( jumpAddr );
|
||||||
|
if( it == m_jumpTable.end() )
|
||||||
|
{
|
||||||
|
m_jumpTable.emplace( jumpAddr, JumpData { min, max, 0, { op.address } } );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if( it->second.min > min ) it->second.min = min;
|
||||||
|
else if( it->second.max < max ) it->second.max = max;
|
||||||
|
it->second.source.emplace_back( op.address );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( it->second.min > min ) it->second.min = min;
|
jumpAddr = 0;
|
||||||
else if( it->second.max < max ) it->second.max = max;
|
|
||||||
it->second.source.emplace_back( op.address );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user