da2d47
From 3cf33279bcfc69b41bbfae827e4a1e6b3917d7a2 Mon Sep 17 00:00:00 2001
da2d47
From: Carl Love <cel@us.ibm.com>
da2d47
Date: Fri, 10 Oct 2014 13:07:11 -0500
da2d47
Subject: [PATCH] PPC64 sys_mem_info array size is wrong
da2d47
da2d47
The variable sys_mem_info is an array of type PAPI_mh_info_t.  It is
da2d47
statically declared as size 4.  The data for POWER8 is statically
da2d47
declared in entry 4 of the array which is beyond the allocated array.  The
da2d47
array should be declared without a size so the compiler will automatically
da2d47
determine the correct size based on the number of elements being
da2d47
initialized.  This patch makes the change.
da2d47
da2d47
Signed-off-by: Carl Love <cel@us.ibm.com>
da2d47
---
da2d47
 src/linux-memory.c | 2 +-
da2d47
 1 file changed, 1 insertion(+), 1 deletion(-)
da2d47
da2d47
diff --git a/src/linux-memory.c b/src/linux-memory.c
da2d47
index bf6c420..1686299 100644
da2d47
--- a/src/linux-memory.c
da2d47
+++ b/src/linux-memory.c
da2d47
@@ -315,7 +315,7 @@ ia64_get_memory_info( PAPI_hw_info_t * hw_info )
da2d47
 
da2d47
 #if defined(__powerpc__)
da2d47
 
da2d47
-PAPI_mh_info_t sys_mem_info[4] = {
da2d47
+PAPI_mh_info_t sys_mem_info[] = {
da2d47
 	{2,						 // 970 begin
da2d47
 	 {
da2d47
 	  {						 // level 1 begins
da2d47
-- 
da2d47
1.8.4.2
da2d47