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

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