mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
GP-21_emteere fix for slow performance when creating functions with
disjointed address sets
This commit is contained in:
parent
0bfcb5b8cd
commit
fa31a01a10
1 changed files with 8 additions and 7 deletions
|
@ -204,13 +204,14 @@ public class NamespaceManager implements ManagerDB {
|
|||
* @throws OverlappingNamespaceException if the address set to test overlaps a namespace body.
|
||||
*/
|
||||
public void overlapsNamespace(AddressSetView set) throws OverlappingNamespaceException {
|
||||
AddressRangeIterator iter =
|
||||
namespaceMap.getAddressRanges(set.getMinAddress(), set.getMaxAddress());
|
||||
while (iter.hasNext()) {
|
||||
AddressRange range = iter.next();
|
||||
if (set.intersects(range.getMinAddress(), range.getMaxAddress())) {
|
||||
throw new OverlappingNamespaceException(range.getMinAddress(),
|
||||
range.getMaxAddress());
|
||||
AddressRangeIterator addressRanges = set.getAddressRanges();
|
||||
for (AddressRange addressRange : addressRanges) {
|
||||
AddressRangeIterator namesSpaceRanges = namespaceMap.getAddressRanges(
|
||||
addressRange.getMinAddress(), addressRange.getMaxAddress());
|
||||
AddressRange existingRange = namesSpaceRanges.next();
|
||||
if (existingRange != null) {
|
||||
throw new OverlappingNamespaceException(existingRange.getMinAddress(),
|
||||
existingRange.getMaxAddress());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue