From d98007761887582f8ab25414ba5784eb238d06d8 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sat, 10 Oct 2015 10:48:05 +1030 Subject: [PATCH] Bug 19113 - read.c stringer assertion 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. --- gas/ChangeLog | 6 ++++++ gas/read.c | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 1d08101fead..90b358bd70f 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2015-10-10 Alan Modra + + PR gas/19113 + * read.c (next_char_of_string): Mask char after escape. Use + CHAR_MASK rather than 0xff. + 2015-10-07 Yao Qi * config/tc-aarch64.c (md_begin): Access field 'name' rather diff --git a/gas/read.c b/gas/read.c index a3e83c3440c..53440de8c53 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; -- 2.30.2