Fix vvp memory leak for VPI call with no calltf.

If a VPI call with real arguments has no calltf function, we still
need to pop the arguments off the vthread stack. Similarly, if it
has a real result, we need to push a value onto the vthread stack.
This commit is contained in:
Martin Whitaker 2013-05-18 21:22:44 +01:00
parent 9a69fcff7b
commit 10ec58703f
1 changed files with 9 additions and 10 deletions

View File

@ -911,7 +911,7 @@ void vpip_execute_vpi_call(vthread_t thr, vpiHandle ref)
} }
vpi_put_value(ref, &val, 0, vpiNoDelay); vpi_put_value(ref, &val, 0, vpiNoDelay);
} }
}
if (vpip_cur_task->real_stack > 0) if (vpip_cur_task->real_stack > 0)
vthread_pop_real(thr, vpip_cur_task->real_stack); vthread_pop_real(thr, vpip_cur_task->real_stack);
if (vpip_cur_task->string_stack > 0) if (vpip_cur_task->string_stack > 0)
@ -922,7 +922,6 @@ void vpip_execute_vpi_call(vthread_t thr, vpiHandle ref)
if (sysfunc_real*func_real = dynamic_cast<sysfunc_real*>(ref)) { if (sysfunc_real*func_real = dynamic_cast<sysfunc_real*>(ref)) {
vthread_push_real(thr, func_real->return_value_); vthread_push_real(thr, func_real->return_value_);
} }
}
} }
/* /*