From 6d41e2083acf10166704d2fcc7e6909a9c0553ed Mon Sep 17 00:00:00 2001
From: Asim YarKhan <yarkhan@icl.utk.edu>
Date: Wed, 15 Oct 2014 14:22:13 -0400
Subject: [PATCH 43/44] PPC64 sys_mem_info array size is wrong

Thanks to Carl Love for this patch and the following description:
The variable sys_mem_info is an array of type PAPI_mh_info_t.  It is
statically declared as size 4.  The data for POWER8 is statically
declared in entry 4 of the array which is beyond the allocated array.  The
array should be declared without a size so the compiler will automatically
determine the correct size based on the number of elements being
initialized.  This patch makes the change.
---
 src/linux-memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/linux-memory.c b/src/linux-memory.c
index bf6c420..1686299 100644
--- a/src/linux-memory.c
+++ b/src/linux-memory.c
@@ -315,7 +315,7 @@ ia64_get_memory_info( PAPI_hw_info_t * hw_info )
 
 #if defined(__powerpc__)
 
-PAPI_mh_info_t sys_mem_info[4] = {
+PAPI_mh_info_t sys_mem_info[] = {
 	{2,						 // 970 begin
 	 {
 	  {						 // level 1 begins
-- 
2.1.1

