diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2016-05-26 11:56:24 +0100 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2016-05-26 11:56:24 +0100 |
commit | 90de9be2effedc706ac45a84dec18cc328d07e64 (patch) | |
tree | 2492b828ca6f59f8b911f5884ac9173d3dd44b1f | |
parent | 7dc5034ff2e8559c1cc6afedeb32d17583469d72 (diff) | |
download | gem5-90de9be2effedc706ac45a84dec18cc328d07e64.tar.xz |
mem: Fix MemChecker unique_ptr type mismatch
This patch fixes the type of the unique_ptr instances, to ensure that
the data that is allocated with new[] is also deleted with
delete[]. The issue was highlighted by ASAN.
Change-Id: I2c5510424959d862a9954d83e728d901bb18d309
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Stephan Diestelhorst <stephan.diestelhorst@arm.com>
-rw-r--r-- | src/mem/mem_checker_monitor.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mem/mem_checker_monitor.cc b/src/mem/mem_checker_monitor.cc index 7c0605ca5..971dfc048 100644 --- a/src/mem/mem_checker_monitor.cc +++ b/src/mem/mem_checker_monitor.cc @@ -157,7 +157,7 @@ MemCheckerMonitor::recvTimingReq(PacketPtr pkt) unsigned size = pkt->getSize(); Addr addr = pkt->getAddr(); bool expects_response = pkt->needsResponse() && !pkt->cacheResponding(); - std::unique_ptr<uint8_t> pkt_data; + std::unique_ptr<uint8_t[]> pkt_data; MemCheckerMonitorSenderState* state = NULL; if (expects_response && is_write) { @@ -246,7 +246,7 @@ MemCheckerMonitor::recvTimingResp(PacketPtr pkt) bool is_failed_LLSC = pkt->isLLSC() && pkt->req->getExtraData() == 0; unsigned size = pkt->getSize(); Addr addr = pkt->getAddr(); - std::unique_ptr<uint8_t> pkt_data; + std::unique_ptr<uint8_t[]> pkt_data; MemCheckerMonitorSenderState* received_state = NULL; if (is_read) { |