This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Bug 19113 - read.c stringer assertion
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Sat, 10 Oct 2015 10:54:35 +1030
- Subject: Bug 19113 - read.c stringer assertion
- Authentication-results: sourceware.org; auth=none
Fails due to signed char promotion.
PR gas/19113
* read.c (next_char_of_string): Mask char after escape. Use
CHAR_MASK rather than 0xff.
diff --git a/gas/read.c b/gas/read.c
index a3e83c3..53440de 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -5415,7 +5415,7 @@ next_char_of_string (void)
#ifndef NO_STRING_ESCAPES
case '\\':
- switch (c = *input_line_pointer++)
+ switch (c = *input_line_pointer++ & CHAR_MASK)
{
case 'b':
c = '\b';
@@ -5466,7 +5466,7 @@ next_char_of_string (void)
number = number * 8 + c - '0';
}
- c = number & 0xff;
+ c = number & CHAR_MASK;
}
--input_line_pointer;
break;
@@ -5488,7 +5488,7 @@ next_char_of_string (void)
number = number * 16 + c - 'a' + 10;
c = *input_line_pointer++;
}
- c = number & 0xff;
+ c = number & CHAR_MASK;
--input_line_pointer;
}
break;
--
Alan Modra
Australia Development Lab, IBM