mem-cache: Fix destructor of `BasePrefetcher::PrefetchInfo`.
authorIsaac Sánchez Barrera <isaac.sanchez@bsc.es>
Fri, 15 Nov 2019 14:55:42 +0000 (15:55 +0100)
committerIsaac Sánchez Barrera <isaac.sanchez@bsc.es>
Mon, 18 Nov 2019 11:10:21 +0000 (11:10 +0000)
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 <isaac.sanchez@bsc.es>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22843
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/mem/cache/prefetch/base.hh

index e31dbfd4017022aa87c939a933f939dd57c0a782..77d2f3697e87ebb9619a2c41ac8fe8da22efdda2 100644 (file)
@@ -249,7 +249,7 @@ class BasePrefetcher : public ClockedObject
 
         ~PrefetchInfo()
         {
-            delete data;
+            delete[] data;
         }
     };