aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/config/tc-aarch64.c2
-rw-r--r--gas/testsuite/gas/aarch64/reglike-label-unicode-segv.d8
-rw-r--r--gas/testsuite/gas/aarch64/reglike-label-unicode-segv.s2
4 files changed, 18 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 864c6cd..c4b04f0 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,10 @@
+2020-07-02 Alex Coplan <alex.coplan@arm.com>
+
+ * config/tc-aarch64.c (reg_name_p): Fix cast so that we don't
+ segfault on negative chars.
+ * testsuite/gas/aarch64/reglike-label-unicode-segv.d: New test.
+ * testsuite/gas/aarch64/reglike-label-unicode-segv.s: Input.
+
2020-07-02 Nick Clifton <nickc@redhat.com>
PR 26028
diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
index 728fd10..ecb15d2 100644
--- a/gas/config/tc-aarch64.c
+++ b/gas/config/tc-aarch64.c
@@ -2190,7 +2190,7 @@ reg_name_p (char *str, aarch64_reg_type reg_type)
return FALSE;
skip_whitespace (str);
- if (*str == ',' || is_end_of_line[(unsigned int) *str])
+ if (*str == ',' || is_end_of_line[(unsigned char) *str])
return TRUE;
return FALSE;
diff --git a/gas/testsuite/gas/aarch64/reglike-label-unicode-segv.d b/gas/testsuite/gas/aarch64/reglike-label-unicode-segv.d
new file mode 100644
index 0000000..f262e6f
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/reglike-label-unicode-segv.d
@@ -0,0 +1,8 @@
+#objdump: -dr
+
+.*: file format .*
+
+Disassembly of section \.text:
+
+0+ <x0é>:
+.*: 00000000 udf #0
diff --git a/gas/testsuite/gas/aarch64/reglike-label-unicode-segv.s b/gas/testsuite/gas/aarch64/reglike-label-unicode-segv.s
new file mode 100644
index 0000000..18f1e92
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/reglike-label-unicode-segv.s
@@ -0,0 +1,2 @@
+x0é:
+udf x0é