From 1764e9fd087cb3e465f8779cf3736a80b9b94a5e Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Mon, 22 Jun 2020 16:37:02 -0700 Subject: [PATCH] SCP: Rework REGister Sanity Checks to reject 0 bit wide register definitions --- scp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scp.c b/scp.c index 36335644..301c576e 100644 --- a/scp.c +++ b/scp.c @@ -15396,6 +15396,10 @@ for (i = 0; (dptr = sim_devices[i]) != NULL; i++) { Bad = TRUE; Mprintf (f, "%u bits at offset %u is wider than the maximum allowed width of %u bits\n", rptr->width, rptr->offset, (uint32)(8 * sizeof(t_value))); } + if (rptr->width == 0) { + Bad = TRUE; + Mprintf (f, "a 0 bit wide register is meaningless\n"); + } if ((rptr->obj_size != 0) && (rptr->ele_size != 0) && (rptr->depth != 0) && (rptr->macro != NULL)) { if (rptr->flags & REG_UNIT) { if (udptr == NULL) {