mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-12 20:03:45 +08:00
x86: Check unbalanced braces in memory reference
Check unbalanced braces in memory reference to avoid assembler crash
caused by
commit e87fb6a6d0
Author: Jan Beulich <jbeulich@suse.com>
Date: Wed Oct 5 09:16:24 2022 +0200
x86/gas: support quoted address scale factor in AT&T syntax
PR gas/30248
* config/tc-i386.c (i386_att_operand): Check unbalanced braces
in memory reference.
* testsuite/gas/i386/i386.exp: Run pr30248.
* testsuite/gas/i386/pr30248.d: New file.
* testsuite/gas/i386/pr30248.err: Likewise.
* testsuite/gas/i386/pr30248.s: Likewise.
This commit is contained in:
parent
70ea5a46bd
commit
100f993c53
@ -11613,7 +11613,11 @@ i386_att_operand (char *operand_string)
|
||||
temp_string = base_string;
|
||||
|
||||
/* Skip past '(' and whitespace. */
|
||||
gas_assert (*base_string == '(');
|
||||
if (*base_string != '(')
|
||||
{
|
||||
as_bad (_("unbalanced braces"));
|
||||
return 0;
|
||||
}
|
||||
++base_string;
|
||||
if (is_space_char (*base_string))
|
||||
++base_string;
|
||||
|
@ -752,6 +752,7 @@ run_dump_test pr19498
|
||||
run_list_test "nop-bad-1" ""
|
||||
run_list_test "unspec" ""
|
||||
run_dump_test "fp"
|
||||
run_dump_test pr30248
|
||||
if {[is_elf_format] || [istarget "*-*-vxworks*"]} then {
|
||||
run_list_test_stdin "list-1" "-al"
|
||||
run_list_test_stdin "list-2" "-al"
|
||||
|
2
gas/testsuite/gas/i386/pr30248.d
Normal file
2
gas/testsuite/gas/i386/pr30248.d
Normal file
@ -0,0 +1,2 @@
|
||||
#as:
|
||||
#error_output: pr30248.err
|
5
gas/testsuite/gas/i386/pr30248.err
Normal file
5
gas/testsuite/gas/i386/pr30248.err
Normal file
@ -0,0 +1,5 @@
|
||||
#failif
|
||||
|
||||
#...
|
||||
.*Internal error.*
|
||||
#pass
|
2
gas/testsuite/gas/i386/pr30248.s
Normal file
2
gas/testsuite/gas/i386/pr30248.s
Normal file
@ -0,0 +1,2 @@
|
||||
.text
|
||||
lgs ")"""
|
Loading…
Reference in New Issue
Block a user