From: Dongxue Zhang Date: Tue, 15 Sep 2015 13:14:07 +0000 (-0500) Subject: dev: IDE Disk: Handle bad IDE image size X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=58ec70444d9cfa50c7405d76a04cda5f9a43e1a1;p=gem5.git dev: IDE Disk: Handle bad IDE image size Handle bad IDE disk image size 0. When image size is 0, gem5 will cause an exception with log "Floating point exception (core dumped)". Committed by: Nilay Vaish --- diff --git a/src/dev/ide_disk.cc b/src/dev/ide_disk.cc index 7298da521..2c8dfceb1 100644 --- a/src/dev/ide_disk.cc +++ b/src/dev/ide_disk.cc @@ -90,6 +90,8 @@ IdeDisk::IdeDisk(const Params *p) } else { if (lba_size >= 63) sectors = 63; + else if (lba_size == 0) + panic("Bad IDE image size: 0\n"); else sectors = lba_size;