103a104,105
> void report_error(const char *id, const char *add_msg) const;
>
128c130,133
< sc_assert(!_interfaces.empty());
---
> if (_interfaces.empty()) {
> report_error("(E112) get interface failed", "port is not bound");
> sc_abort();
> }
134c139,142
< sc_assert(!_interfaces.empty());
---
> if (_interfaces.empty()) {
> report_error("(E112) get interface failed", "port is not bound");
> sc_abort();
> }
141c149,152
< sc_assert(_interfaces.size() > n);
---
> if (n < 0 || n >= size()) {
> report_error("(E112) get interface failed", "index out of range");
> return NULL;
> }
147c158,161
< sc_assert(_interfaces.size() > n);
---
> if (n < 0 || n >= size()) {
> report_error("(E112) get interface failed", "index out of range");
> return NULL;
> }
154c168,169
< sc_assert(!_interfaces.empty());
---
> if (_interfaces.empty())
> return NULL;
160c175,176
< sc_assert(!_interfaces.empty());
---
> if (_interfaces.empty())
> return NULL;
204c220,223
< sc_assert(_interfaces.size() > n);
---
> if (n < 0 || n >= size()) {
> report_error("(E112) get interface failed", "index out of range");
> return NULL;
> }
208c227
< _gem5AddInterface(sc_interface *i)
---
> _gem5AddInterface(sc_interface *iface)
210c229
< IF *interface = dynamic_cast<IF *>(i);
---
> IF *interface = dynamic_cast<IF *>(iface);
211a231,236
> for (int i = 0; i < _interfaces.size(); i++) {
> if (interface == _interfaces[i]) {
> report_error("(E107) bind interface to port failed",
> "interface already bound to port");
> }
> }