Fix bad delete in verilated_save.h (#2462)

This commit is contained in:
Marshal Qiao 2020-07-14 06:39:00 -04:00 committed by Wilson Snyder
parent 25bbbbd37b
commit d55c233427

View File

@ -55,7 +55,7 @@ public:
}
virtual ~VerilatedSerialize() {
close();
if (m_bufp) VL_DO_CLEAR(delete m_bufp, m_bufp = NULL);
if (m_bufp) VL_DO_CLEAR(delete [] m_bufp, m_bufp = NULL);
}
// METHODS
bool isOpen() const { return m_isOpen; }
@ -118,7 +118,7 @@ public:
}
virtual ~VerilatedDeserialize() {
close();
if (m_bufp) VL_DO_CLEAR(delete m_bufp, m_bufp = NULL);
if (m_bufp) VL_DO_CLEAR(delete [] m_bufp, m_bufp = NULL);
}
// METHODS
bool isOpen() const { return m_isOpen; }