review fixes

This commit is contained in:
ghidravore 2019-07-18 18:27:22 -04:00
parent 57e2171dd4
commit 265e010273
2 changed files with 6 additions and 8 deletions

View File

@ -99,17 +99,14 @@ public class MemoryBlockSourceInfo {
/**
* Returns the offset into the {@link FileBytes} object for the given address or
* -1 if this SourceInfo does not have an associated {@link FileBytes} or the address doesn't
* belong to this SourceInfo.
* -1 if this MemoryBlockSourceInfo does not have an associated {@link FileBytes} or the address doesn't
* belong to this MemoryBlockSourceInfo.
*
* @param address the address for which to get an offset into the {@link FileBytes} object.
* @return the offset into the {@link FileBytes} object for the given address.
*/
public long getFileBytesOffset(Address address) {
if (!contains(address)) {
return -1;
}
if (subBlock instanceof FileBytesSubMemoryBlock) {
if (subBlock instanceof FileBytesSubMemoryBlock && contains(address)) {
long blockOffset = address.subtract(getMinAddress());
long subBlockOffset = blockOffset - subBlock.startingOffset;
return ((FileBytesSubMemoryBlock) subBlock).getFileBytesOffset() + subBlockOffset;

View File

@ -752,8 +752,9 @@ public interface Memory extends AddressSetView {
/**
* Returns information ({@link AddressSourceInfo}) about the byte source at the given address.
* @param address the address to query.
* @return information ({@link AddressSourceInfo}) about the byte source at the given address.
* @param address the address to query. Returns null if the address is not in memory.
* @return information ({@link AddressSourceInfo}) about the byte source at the given address or
* null if the address is not in memory.
*/
public AddressSourceInfo getAddressSourceInfo(Address address);
}