From b83144c5523fadbd4ef8f5d0e9a5e855631aad95 Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Tue, 2 Dec 2014 13:02:46 -0800 Subject: [PATCH] The __vpiArray::set_word method should take a reference. Seem to have missed a case where a vvp_vector4_t can be passed by const reference instead of by value. --- vvp/array.cc | 2 +- vvp/vpi_priv.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vvp/array.cc b/vvp/array.cc index 81f0bd065..d6287a3e9 100644 --- a/vvp/array.cc +++ b/vvp/array.cc @@ -545,7 +545,7 @@ void __vpiArrayVthrAPV::vpi_get_value(p_vpi_value vp) } } -void __vpiArray::set_word(unsigned address, unsigned part_off, vvp_vector4_t val) +void __vpiArray::set_word(unsigned address, unsigned part_off, const vvp_vector4_t&val) { if (address >= get_size()) return; diff --git a/vvp/vpi_priv.h b/vvp/vpi_priv.h index 44531faf7..56f5c88d9 100644 --- a/vvp/vpi_priv.h +++ b/vvp/vpi_priv.h @@ -605,7 +605,7 @@ struct __vpiArray : public __vpiArrayBase, public __vpiHandle { inline vpiHandle vpi_iterate(int code) { return vpi_array_base_iterate(code); } vpiHandle vpi_index(int idx); - void set_word(unsigned idx, unsigned off, vvp_vector4_t val); + void set_word(unsigned idx, unsigned off, const vvp_vector4_t&val); void set_word(unsigned idx, double val); void set_word(unsigned idx, const std::string&val); void set_word(unsigned idx, const vvp_object_t&val);