From 58ec70444d9cfa50c7405d76a04cda5f9a43e1a1 Mon Sep 17 00:00:00 2001 From: Dongxue Zhang Date: Tue, 15 Sep 2015 08:14:07 -0500 Subject: [PATCH] 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 --- src/dev/ide_disk.cc | 2 ++ 1 file changed, 2 insertions(+) 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; -- 2.30.2