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:
parent
8a6626dcaa
commit
77f8d3225c
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue