diff --git a/vvp/class_type.cc b/vvp/class_type.cc index 3170ef625..c6bca6440 100644 --- a/vvp/class_type.cc +++ b/vvp/class_type.cc @@ -203,11 +203,14 @@ template void property_atom::set_vec4(char*buf, const vvp_vector4_t template void property_atom::get_vec4(char*buf, vvp_vector4_t&val) { T*src = reinterpret_cast (buf+offset_); - const size_t tmp_cnt = (sizeof(T) + sizeof(unsigned long)-1)/sizeof(unsigned long); + const size_t tmp_cnt = sizeof(T)> idx * 8 * sizeof(tmp[0]); val.resize(8*sizeof(T)); val.setarray(0, val.size(), tmp);