diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index ed8329f25d8..44efad73e5d 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -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; diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp index 590cd783efe..4d2150f9c68 100644 --- a/gas/testsuite/gas/i386/i386.exp +++ b/gas/testsuite/gas/i386/i386.exp @@ -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" diff --git a/gas/testsuite/gas/i386/pr30248.d b/gas/testsuite/gas/i386/pr30248.d new file mode 100644 index 00000000000..a6efd26e2c5 --- /dev/null +++ b/gas/testsuite/gas/i386/pr30248.d @@ -0,0 +1,2 @@ +#as: +#error_output: pr30248.err diff --git a/gas/testsuite/gas/i386/pr30248.err b/gas/testsuite/gas/i386/pr30248.err new file mode 100644 index 00000000000..1f71543e1d4 --- /dev/null +++ b/gas/testsuite/gas/i386/pr30248.err @@ -0,0 +1,5 @@ +#failif + +#... +.*Internal error.* +#pass diff --git a/gas/testsuite/gas/i386/pr30248.s b/gas/testsuite/gas/i386/pr30248.s new file mode 100644 index 00000000000..ab875008f3d --- /dev/null +++ b/gas/testsuite/gas/i386/pr30248.s @@ -0,0 +1,2 @@ + .text + lgs ")"""