From c2f90ac911242c07453f664d7cacb59dd394f5d1 Mon Sep 17 00:00:00 2001 From: steve Date: Sat, 1 Mar 2003 00:46:13 +0000 Subject: [PATCH] Careful about compiletf calls. --- vvp/vpi_vthr_vector.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/vvp/vpi_vthr_vector.cc b/vvp/vpi_vthr_vector.cc index c27a0a8fb..cd30a8581 100644 --- a/vvp/vpi_vthr_vector.cc +++ b/vvp/vpi_vthr_vector.cc @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: vpi_vthr_vector.cc,v 1.12 2003/02/09 23:33:26 steve Exp $" +#ident "$Id: vpi_vthr_vector.cc,v 1.13 2003/03/01 00:46:13 steve Exp $" #endif /* @@ -390,7 +390,16 @@ static void vthr_real_get_value(vpiHandle ref, s_vpi_value*vp) struct __vpiVThrWord*obj = (struct __vpiVThrWord*)ref; static char buf[66]; - double val = vthread_get_real(vpip_current_vthread, obj->index); + + double val = 0.0; + + /* Get the actual value from the index. It is possible, by the + way, that the vpi_get_value is called from compiletf. If + that's the case, there will be no current thread, and this + will not have access to the proper value. Punt and return a + 0.0 value instead. */ + if (vpip_current_vthread) + val = vthread_get_real(vpip_current_vthread, obj->index); switch (vp->format) { @@ -469,6 +478,9 @@ vpiHandle vpip_make_vthr_word(unsigned base, const char*type) /* * $Log: vpi_vthr_vector.cc,v $ + * Revision 1.13 2003/03/01 00:46:13 steve + * Careful about compiletf calls. + * * Revision 1.12 2003/02/09 23:33:26 steve * Spelling fixes. *