Blame SOURCES/gdb-rhbz1182151-ibm-z13-13of22.patch

0b42f8
commit 6dbc9c045741c27435b9b23246c2113221b26c2f
0b42f8
Author: Andreas Arnez <arnez@linux.vnet.ibm.com>
0b42f8
Date:   Mon Apr 27 11:38:46 2015 +0200
0b42f8
0b42f8
    S390: For zero, let is_power_of_two() return false
0b42f8
    
0b42f8
    This fixes a minor issue with the helper function is_power_of_two(),
0b42f8
    which returned non-zero ("true") if the argument was zero.  This led
0b42f8
    to a wrong decision when passing a zero-sized struct in an inferior
0b42f8
    function call.
0b42f8
    
0b42f8
    gdb/ChangeLog:
0b42f8
    
0b42f8
    	* s390-linux-tdep.c (is_power_of_two): Add comment.  Return
0b42f8
    	  false if the argument is zero.
0b42f8
0b42f8
### a/gdb/ChangeLog
0b42f8
### b/gdb/ChangeLog
0b42f8
## -1,3 +1,8 @@
0b42f8
+2015-04-27  Andreas Arnez  <arnez@linux.vnet.ibm.com>
0b42f8
+
0b42f8
+	* s390-linux-tdep.c (is_power_of_two): Add comment.  Return
0b42f8
+	  false if the argument is zero.
0b42f8
+
0b42f8
 2015-04-27  Pierre-Marie de Rodat  <derodat@adacore.com>
0b42f8
 
0b42f8
 	* ada-lang.c (template_to_static_fixed_type): Return input type
0b42f8
Index: gdb-7.6.1/gdb/s390-tdep.c
0b42f8
===================================================================
0b42f8
--- gdb-7.6.1.orig/gdb/s390-tdep.c	2016-02-21 22:13:34.600107988 +0100
0b42f8
+++ gdb-7.6.1/gdb/s390-tdep.c	2016-02-21 22:14:09.318523194 +0100
0b42f8
@@ -2641,11 +2641,12 @@
0b42f8
           || is_float_singleton (type));
0b42f8
 }
0b42f8
 
0b42f8
+/* Determine whether N is a power of two.  */
0b42f8
 
0b42f8
 static int
0b42f8
 is_power_of_two (ULONGEST n)
0b42f8
 {
0b42f8
-  return ((n & (n - 1)) == 0);
0b42f8
+  return n && ((n & (n - 1)) == 0);
0b42f8
 }
0b42f8
 
0b42f8
 /* Return non-zero if TYPE should be passed as a pointer to a copy,