]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR 66827
authornickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 21 Dec 2015 08:23:35 +0000 (08:23 +0000)
committernickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 21 Dec 2015 08:23:35 +0000 (08:23 +0000)
* regex.c (EXTRACT_NUMBER): Cast sign byte to unsigned before left
shifting.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231873 138bc75d-0d04-0410-961f-82ee72b054a4

libiberty/ChangeLog
libiberty/regex.c

index 673123c8e05589e706f89e60af6947f974fe6158..0bda40e0682e3601d5dab3c98c73f33120c212ca 100644 (file)
@@ -1,3 +1,9 @@
+2015-12-21  Nick Clifton  <nickc@redhat.com>
+
+       PR 66827
+       * regex.c (EXTRACT_NUMBER): Cast sign byte to unsigned before left
+       shifting.
+
 2015-11-27  Pedro Alves  <palves@redhat.com>
 
        PR other/61321
index 16338cb206b455d87d275e778d4590500c213216..9ffc3f47f006d89b7c046b704e7ac6cc0ae78d80 100644 (file)
@@ -685,7 +685,7 @@ typedef enum
 #  define EXTRACT_NUMBER(destination, source)                          \
   do {                                                                 \
     (destination) = *(source) & 0377;                                  \
-    (destination) += SIGN_EXTEND_CHAR (*((source) + 1)) << 8;          \
+    (destination) += ((unsigned) SIGN_EXTEND_CHAR (*((source) + 1))) << 8; \
   } while (0)
 # endif