From 673675fecd2a42d47ac0336f141af7ce4351685b Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Thu, 31 Jan 2013 18:13:36 -0800 Subject: [PATCH] Properly handle class properties what are wider then native. Fix a bug where if a class property were wider then a native long it would get truncated. --- vvp/class_type.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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);