From 0705717efa032108bbdfc801e0828d3925fb89f1 Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Wed, 26 Aug 2009 21:30:38 -0700 Subject: [PATCH] reinterpret_cast is not the run-time-type safe way. Use dynamic_cast. --- vvp/vthread.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vvp/vthread.cc b/vvp/vthread.cc index fb62f9555..13acd2dd0 100644 --- a/vvp/vthread.cc +++ b/vvp/vthread.cc @@ -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 (cp->net->fun); + = dynamic_cast (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 (cp->net->fun); + = dynamic_cast (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(dst->fun); + = dynamic_cast(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(net->fun); + vvp_fun_signal_real*sig = dynamic_cast(net->fun); assert(sig); // This is the net that is forcing me...