mem: Provide better diagnostic for unconnected port

When _masterPort is null, a message to that effect is
more helpful than a segfault.
This commit is contained in:
Curtis Dunham 2014-09-27 09:08:30 -04:00
parent de62aedabc
commit 725be98fe8

View file

@ -404,7 +404,11 @@ class SlavePort : public BaseSlavePort
/**
* Called by the owner to send a range change
*/
void sendRangeChange() const { _masterPort->recvRangeChange(); }
void sendRangeChange() const {
if (!_masterPort)
fatal("%s cannot sendRangeChange() without master port", name());
_masterPort->recvRangeChange();
}
/**
* Get a list of the non-overlapping address ranges the owner is