fix: Provider not having any valid regions by default
This commit is contained in:
parent
37d60411bb
commit
af5b871383
@ -35,15 +35,6 @@ namespace hex::prv {
|
||||
[[nodiscard]] std::string getName() const override { return ""; }
|
||||
|
||||
[[nodiscard]] std::string getTypeName() const override { return "MemoryProvider"; }
|
||||
|
||||
std::pair<Region, bool> getRegionValidity(u64 address) const {
|
||||
address -= this->getBaseAddress();
|
||||
|
||||
if (address < this->getActualSize())
|
||||
return { Region { this->getBaseAddress() + address, this->getActualSize() - address }, true };
|
||||
else
|
||||
return { Region::Invalid(), false };
|
||||
}
|
||||
private:
|
||||
void renameFile();
|
||||
|
||||
|
@ -230,8 +230,11 @@ namespace hex::prv {
|
||||
}
|
||||
|
||||
std::pair<Region, bool> Provider::getRegionValidity(u64 address) const {
|
||||
if ((address - this->getBaseAddress()) > this->getActualSize())
|
||||
return { Region::Invalid(), false };
|
||||
u64 absoluteAddress = address - this->getBaseAddress();
|
||||
|
||||
if (absoluteAddress < this->getActualSize())
|
||||
return { Region { this->getBaseAddress() + absoluteAddress, this->getActualSize() - absoluteAddress }, true };
|
||||
|
||||
|
||||
bool insideValidRegion = false;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user