[PATCH RFA] dwarf2read.c sign extension problem

Kevin Buettner kevinb@cygnus.com
Wed May 10 18:01:00 GMT 2000


I request approval for committing the following patch:

	* dwarf2read.c (dwarf2_const_value_data): Fix typo in sign
	extension code.

Index: dwarf2read.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/dwarf2read.c,v
retrieving revision 2.41
diff -u -p -r2.41 dwarf2read.c
--- dwarf2read.c	2000/05/01 04:46:47	2.41
+++ dwarf2read.c	2000/05/11 00:46:59
@@ -4341,7 +4341,7 @@ dwarf2_const_value_data (struct attribut
       if (TYPE_UNSIGNED (SYMBOL_TYPE (sym)))
 	l &= ((LONGEST) 1 << bits) - 1;
       else
-	l = (l << (sizeof (l) - bits)) >> (sizeof (l) - bits);
+	l = (l << (sizeof (l) * 8 - bits)) >> (sizeof (l) * 8 - bits);
     }
 
   SYMBOL_VALUE (sym) = l;



More information about the Gdb-patches mailing list