From b505af87d146f43c4d72c9ffde57588a58172c23 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Tue, 25 Apr 2006 10:20:37 -0400 Subject: [PATCH] Fix segfault in sinic dev/sinic.cc: check that there is a fault before testing the fault type --HG-- extra : convert_revision : 0cc95ba660655766b779e77d912dbc685cd476a8 --- dev/sinic.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/sinic.cc b/dev/sinic.cc index 363994919..2ce67acca 100644 --- a/dev/sinic.cc +++ b/dev/sinic.cc @@ -363,7 +363,7 @@ Device::read(MemReqPtr &req, uint8_t *data) assert(config.command & PCI_CMD_MSE); Fault fault = readBar(req, data); - if (fault->isMachineCheckFault()) { + if (fault && fault->isMachineCheckFault()) { panic("address does not map to a BAR pa=%#x va=%#x size=%d", req->paddr, req->vaddr, req->size); @@ -459,7 +459,7 @@ Device::write(MemReqPtr &req, const uint8_t *data) assert(config.command & PCI_CMD_MSE); Fault fault = writeBar(req, data); - if (fault->isMachineCheckFault()) { + if (fault && fault->isMachineCheckFault()) { panic("address does not map to a BAR pa=%#x va=%#x size=%d", req->paddr, req->vaddr, req->size); -- 2.30.2