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.
This commit is contained in:
parent
b1a35af270
commit
f405494f21
@ -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
|
||||
|
@ -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;
|
||||
|
8
gas/testsuite/gas/aarch64/reglike-label-unicode-segv.d
Normal file
8
gas/testsuite/gas/aarch64/reglike-label-unicode-segv.d
Normal file
@ -0,0 +1,8 @@
|
||||
#objdump: -dr
|
||||
|
||||
.*: file format .*
|
||||
|
||||
Disassembly of section \.text:
|
||||
|
||||
0+ <x0é>:
|
||||
.*: 00000000 udf #0
|
2
gas/testsuite/gas/aarch64/reglike-label-unicode-segv.s
Normal file
2
gas/testsuite/gas/aarch64/reglike-label-unicode-segv.s
Normal file
@ -0,0 +1,2 @@
|
||||
x0é:
|
||||
udf x0é
|
Loading…
Reference in New Issue
Block a user