From ff4cba6a96dd47f3265ffb37d84e11d6d26b83e9 Mon Sep 17 00:00:00 2001 From: Cary R Date: Fri, 14 Dec 2007 17:17:51 -0800 Subject: [PATCH] Add full argument type checking to $dumpvars. This patch adds argument type checking for $dumpvars module and variable arguments. --- vpi/vcd_priv.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/vpi/vcd_priv.c b/vpi/vcd_priv.c index c93a9a575..feef2607e 100644 --- a/vpi/vcd_priv.c +++ b/vpi/vcd_priv.c @@ -384,7 +384,26 @@ PLI_INT32 sys_dumpvars_compiletf(PLI_BYTE8 *name) /* The rest of the arguments are either a module or a variable. */ while (arg = vpi_scan(argv)) { -/* Need variable checks here. */ + switch(vpi_get(vpiType, arg)) { + /* The module types. */ + case vpiModule: + case vpiTask: + case vpiFunction: + case vpiNamedBegin: + case vpiNamedFork: + /* The variable types. */ + case vpiNet: + case vpiReg: + case vpiMemoryWord: + case vpiIntegerVar: + case vpiTimeVar: + case vpiRealVar: + break; + default: + vpi_mcd_printf(1, "ERROR: %s cannot dump a %s.\n", + name, vpi_get_str(vpiType, arg)); + vpi_control(vpiFinish, 1); + } } return 0;