Blame SOURCES/papi-sys_mem_info.patch

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