mirror of
https://github.com/verilator/verilator.git
synced 2025-01-06 06:37:45 +00:00
Fix over-iterating dpi dimensions (#2703).
This commit is contained in:
parent
d9ef4ac435
commit
c54360485e
@ -2640,7 +2640,7 @@ vluint32_t VerilatedVarProps::entSize() const {
|
||||
|
||||
size_t VerilatedVarProps::totalSize() const {
|
||||
size_t size = entSize();
|
||||
for (int udim = 0; udim <= udims(); ++udim) size *= m_unpacked[udim].elements();
|
||||
for (int udim = 0; udim < udims(); ++udim) size *= m_unpacked[udim].elements();
|
||||
return size;
|
||||
}
|
||||
|
||||
|
@ -75,8 +75,8 @@ class VerilatedVarProps VL_NOT_FINAL {
|
||||
const vluint32_t m_magic; // Magic number
|
||||
const VerilatedVarType m_vltype; // Data type
|
||||
const VerilatedVarFlags m_vlflags; // Direction
|
||||
const int m_pdims; // Packed dimensions
|
||||
const int m_udims; // Unpacked dimensions
|
||||
const int m_pdims; // Packed dimensions, 0 = none
|
||||
const int m_udims; // Unpacked dimensions, 0 = none
|
||||
VerilatedRange m_packed; // Packed array range
|
||||
std::vector<VerilatedRange> m_unpacked; // Unpacked array ranges
|
||||
void initUnpacked(const int* ulims) {
|
||||
|
Loading…
Reference in New Issue
Block a user