From: Isaac Sánchez Barrera Date: Fri, 15 Nov 2019 14:55:42 +0000 (+0100) Subject: mem-cache: Fix destructor of `BasePrefetcher::PrefetchInfo`. X-Git-Tag: v19.0.0.0~293 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ccb3c75fabb36f293793a65d2b8fe05fc899656a;p=gem5.git mem-cache: Fix destructor of `BasePrefetcher::PrefetchInfo`. The destructor of `BasePrefetcher::PrefetchInfo` was calling `delete` for a dynamically-allocated array. Changed to `delete[]` to remove potential undefined behaviour. Change-Id: I6f531bfb6fb7108f1d3e743ae0384d80173e15ef Signed-off-by: Isaac Sánchez Barrera Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22843 Reviewed-by: Nikos Nikoleris Maintainer: Nikos Nikoleris Tested-by: kokoro --- diff --git a/src/mem/cache/prefetch/base.hh b/src/mem/cache/prefetch/base.hh index e31dbfd40..77d2f3697 100644 --- a/src/mem/cache/prefetch/base.hh +++ b/src/mem/cache/prefetch/base.hh @@ -249,7 +249,7 @@ class BasePrefetcher : public ClockedObject ~PrefetchInfo() { - delete data; + delete[] data; } };