Tests: Fix t_vpi_var uninitialized

This commit is contained in:
Wilson Snyder 2013-02-03 12:21:48 -05:00
parent 7d44bba95c
commit 4a5a56f8ef
2 changed files with 2 additions and 1 deletions

View File

@ -107,7 +107,7 @@ public:
// cppcheck-suppress uninitVar // m_value
VerilatedVpioCb(const t_cb_data* cbDatap, QData time)
: m_cbData(*cbDatap), m_time(time) {
m_value.format = cbDatap->value?cbDatap->value->format:vpiSuppressVal;
m_value.format = cbDatap->value ? cbDatap->value->format : vpiSuppressVal;
m_cbData.value = &m_value;
}
virtual ~VerilatedVpioCb() {}

View File

@ -125,6 +125,7 @@ int _mon_check_callbacks() {
cb_data.reason = cbEndOfSimulation;
cb_data.cb_rtn = NULL;
cb_data.user_data = 0;
cb_data.value = NULL;
vpiHandle vh = vpi_register_cb(&cb_data);
CHECK_RESULT_NZ(vh);