From 2e4810ac8a5ef4f62f41a584450cafee815c8eba Mon Sep 17 00:00:00 2001 From: Cary R Date: Tue, 16 Nov 2010 17:25:52 -0800 Subject: [PATCH] V0.9: Assert if the vcdid 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 6edd7d052..25b651688 100644 --- a/vpi/sys_vcd.c +++ b/vpi/sys_vcd.c @@ -75,9 +75,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)