diff options
author | whitequark <whitequark@whitequark.org> | 2020-06-13 22:18:35 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-13 22:18:35 +0000 |
commit | 971a7651555651e569311c6cbe039f0eee8cde93 (patch) | |
tree | 41ba335c6cf8b95697d74b494d4722cb296f4f47 /backends | |
parent | dc6961f3d46657e501ed7115f819d7dd6372b1ce (diff) | |
parent | 6cf02ed94f46d32e6116ba834894f4022fb0d407 (diff) | |
download | yosys-971a7651555651e569311c6cbe039f0eee8cde93.tar.gz yosys-971a7651555651e569311c6cbe039f0eee8cde93.tar.bz2 yosys-971a7651555651e569311c6cbe039f0eee8cde93.zip |
Merge pull request #2151 from whitequark/cxxrtl-fix-rzext
cxxrtl: fix rzext()
Diffstat (limited to 'backends')
-rw-r--r-- | backends/cxxrtl/cxxrtl.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/backends/cxxrtl/cxxrtl.h b/backends/cxxrtl/cxxrtl.h index 2458487e1..c510b33d7 100644 --- a/backends/cxxrtl/cxxrtl.h +++ b/backends/cxxrtl/cxxrtl.h @@ -185,8 +185,8 @@ struct value : public expr_base<value<Bits>> { carry = (shift_bits == 0) ? 0 : data[n] >> (chunk::bits - shift_bits); } - if (carry != 0) - result.data[result.chunks - 1] = carry; + if (shift_chunks + chunks < result.chunks) + result.data[shift_chunks + chunks] = carry; return result; } |