Fix core dump in recent vpi_get_str code changes.

The recent changes to vpi_get_str had a minor problem that was
causing a core dump when trying to get the vpiFullName of an
arrayed signal. Basically vpi_get_str is not reentrant so the
name must be duplicated. It must also be duplicated to work with
the free in the code (do not free a result_buf).
This commit is contained in:
Cary R 2007-12-18 17:33:21 -08:00 committed by Stephen Williams
parent 8a6626dcaa
commit 77f8d3225c
1 changed files with 1 additions and 1 deletions

View File

@ -172,7 +172,7 @@ static char* signal_get_str(int code, vpiHandle ref)
char *nm, *ixs;
if (rfp->parent) {
nm = vpi_get_str(vpiName, rfp->parent);
nm = strdup(vpi_get_str(vpiName, rfp->parent));
s_vpi_value vp;
vp.format = vpiDecStrVal;
vpi_get_value(rfp->id.index, &vp);