reinterpret_cast is not the run-time-type safe way. Use dynamic_cast.

This commit is contained in:
Stephen Williams 2009-08-26 21:30:38 -07:00
parent 4da1ab3df7
commit 0705717efa
1 changed files with 4 additions and 4 deletions

View File

@ -990,7 +990,7 @@ bool of_ASSIGN_V0X1(vthread_t thr, vvp_code_t cp)
unsigned bit = cp->bit_idx[1];
vvp_signal_value*sig
= reinterpret_cast<vvp_signal_value*> (cp->net->fun);
= dynamic_cast<vvp_signal_value*> (cp->net->fun);
assert(sig);
// We fell off the MSB end.
@ -1027,7 +1027,7 @@ bool of_ASSIGN_V0X1D(vthread_t thr, vvp_code_t cp)
unsigned bit = cp->bit_idx[1];
vvp_signal_value*sig
= reinterpret_cast<vvp_signal_value*> (cp->net->fun);
= dynamic_cast<vvp_signal_value*> (cp->net->fun);
assert(sig);
// We fell off the MSB end.
@ -1232,7 +1232,7 @@ bool of_CASSIGN_LINK(vthread_t thr, vvp_code_t cp)
vvp_net_t*src = cp->net2;
vvp_fun_signal_base*sig
= reinterpret_cast<vvp_fun_signal_base*>(dst->fun);
= dynamic_cast<vvp_fun_signal_base*>(dst->fun);
assert(sig);
/* Detect the special case that we are already continuous
@ -1773,7 +1773,7 @@ bool of_DEASSIGN_WR(vthread_t thr, vvp_code_t cp)
{
vvp_net_t*net = cp->net;
vvp_fun_signal_real*sig = reinterpret_cast<vvp_fun_signal_real*>(net->fun);
vvp_fun_signal_real*sig = dynamic_cast<vvp_fun_signal_real*>(net->fun);
assert(sig);
// This is the net that is forcing me...