From bebdcd5adf728c1928ed8025488c8e19f45db80f Mon Sep 17 00:00:00 2001 From: Cary R Date: Tue, 16 Nov 2010 17:21:51 -0800 Subject: [PATCH] Assert if the vcdid generation overflows. It should never happen, but if it does assert vs generating an invalid VCD identifier. --- vpi/sys_vcd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vpi/sys_vcd.c b/vpi/sys_vcd.c index 94d863594..2e47ee427 100644 --- a/vpi/sys_vcd.c +++ b/vpi/sys_vcd.c @@ -76,9 +76,11 @@ static void gen_new_vcd_id(void) v /= 94; if(!v) { vcdid[i+1] = '\0'; - break; + return; } } + // This should never happen since 94**7 is a lot if identifiers! + assert(0); } static char *truncate_bitvec(char *s)