From d55c233427330d22a5ac65cb84bc42ca9e048db4 Mon Sep 17 00:00:00 2001 From: Marshal Qiao Date: Tue, 14 Jul 2020 06:39:00 -0400 Subject: [PATCH] Fix bad delete in verilated_save.h (#2462) --- include/verilated_save.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/verilated_save.h b/include/verilated_save.h index 74ea32d83..9925194ef 100644 --- a/include/verilated_save.h +++ b/include/verilated_save.h @@ -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; }