• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revisionf405494f214315091fb0864827b07b5e6f12ee84 (tree)
Zeit2020-07-02 21:53:07
AutorAlex Coplan <alex.coplan@arm....>
CommiterAlex Coplan

Log Message

aarch64: Fix segfault on unicode symbols

This patch fixes a segfault which occurs when the AArch64 backend parses
a symbol operand that begins with a register name and ends with a
unicode byte (byte value > 127).

For example, the following input causes the crash:

x0é: udf x0é

gas/ChangeLog:

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.

Ändern Zusammenfassung

Diff

--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,10 @@
1+2020-07-02 Alex Coplan <alex.coplan@arm.com>
2+
3+ * config/tc-aarch64.c (reg_name_p): Fix cast so that we don't
4+ segfault on negative chars.
5+ * testsuite/gas/aarch64/reglike-label-unicode-segv.d: New test.
6+ * testsuite/gas/aarch64/reglike-label-unicode-segv.s: Input.
7+
18 2020-07-02 Nick Clifton <nickc@redhat.com>
29
310 PR 26028
--- 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)
21902190 return FALSE;
21912191
21922192 skip_whitespace (str);
2193- if (*str == ',' || is_end_of_line[(unsigned int) *str])
2193+ if (*str == ',' || is_end_of_line[(unsigned char) *str])
21942194 return TRUE;
21952195
21962196 return FALSE;
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/reglike-label-unicode-segv.d
@@ -0,0 +1,8 @@
1+#objdump: -dr
2+
3+.*: file format .*
4+
5+Disassembly of section \.text:
6+
7+0+ <x0é>:
8+.*: 00000000 udf #0
--- /dev/null
+++ b/gas/testsuite/gas/aarch64/reglike-label-unicode-segv.s
@@ -0,0 +1,2 @@
1+x0é:
2+udf x0é