Created too mane vvp_net_t objects?
The functor_ref_lookup() function fills its argument in with the vvp_net_t* pointer that matches the var name, so there is no need to create the vvp_net_t object before then.
This commit is contained in:
parent
1530594b4b
commit
f497dbf01e
|
|
@ -1164,7 +1164,7 @@ vpiHandle vpip_make_PV(char*var, int base, int width)
|
||||||
obj->tbase = base;
|
obj->tbase = base;
|
||||||
obj->twid = 0;
|
obj->twid = 0;
|
||||||
obj->width = (unsigned) width;
|
obj->width = (unsigned) width;
|
||||||
obj->net = (vvp_net_t*) malloc(sizeof(vvp_net_t));
|
obj->net = 0;
|
||||||
functor_ref_lookup(&obj->net, var);
|
functor_ref_lookup(&obj->net, var);
|
||||||
|
|
||||||
return &obj->base;
|
return &obj->base;
|
||||||
|
|
@ -1179,7 +1179,7 @@ vpiHandle vpip_make_PV(char*var, char*symbol, int width)
|
||||||
obj->tbase = 0;
|
obj->tbase = 0;
|
||||||
obj->twid = 0;
|
obj->twid = 0;
|
||||||
obj->width = (unsigned) width;
|
obj->width = (unsigned) width;
|
||||||
obj->net = (vvp_net_t*) malloc(sizeof(vvp_net_t));
|
obj->net = 0;
|
||||||
functor_ref_lookup(&obj->net, var);
|
functor_ref_lookup(&obj->net, var);
|
||||||
|
|
||||||
return &obj->base;
|
return &obj->base;
|
||||||
|
|
@ -1194,7 +1194,7 @@ vpiHandle vpip_make_PV(char*var, int tbase, int twid, int width)
|
||||||
obj->tbase = tbase;
|
obj->tbase = tbase;
|
||||||
obj->twid = (unsigned) twid;
|
obj->twid = (unsigned) twid;
|
||||||
obj->width = (unsigned) width;
|
obj->width = (unsigned) width;
|
||||||
obj->net = (vvp_net_t*) malloc(sizeof(vvp_net_t));
|
obj->net = 0;
|
||||||
functor_ref_lookup(&obj->net, var);
|
functor_ref_lookup(&obj->net, var);
|
||||||
|
|
||||||
return &obj->base;
|
return &obj->base;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue