]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gas/ChangeLog
x86: better respect quotes in parse_operands()
authorJan Beulich <jbeulich@suse.com>
Mon, 7 Jun 2021 10:05:02 +0000 (12:05 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 7 Jun 2021 10:05:02 +0000 (12:05 +0200)
commite68c3d59acd09748a65233879033b947a9d1ad51
tree8adbe25bd88ac510dff521a6619a90b0678805ea
parent014fbcda4c662c275532eb0e0e7ef57f46bd7321
x86: better respect quotes in parse_operands()

When d02603dc201f ("Allow symbol and label names to be enclosed in
double quotes") added the check for a double quote to the loop body
there, it didn't go quite far enough: Parentheses inside quotes
shouldn't be counted, and character restrictions also shouldn't apply
inside quoted regions.

In i386_att_operand(), which needs adjustment to remain in sync, besides
respecting double quotes now, also change the logic such that we don't
count parentheses anymore: Finding any opening or closing parenthesis or
any double quote means we're done, because the subsequent parsing code
wouldn't accept (extra) instances of these anyway.

Note that in parse_operands() this mimics get_symbol_name()'s
questionable behavior of treating \ specially only when ahead of ". (The
behavior is suspicious because the meaning of \\ then is ambiguous. It
is in particular impossible to have a (quoted) symbol name end in a
single \.) I would have used get_symbol_name() here, if that didn't
require fiddling with input_line_pointer.
gas/ChangeLog
gas/config/tc-i386.c
gas/testsuite/gas/i386/quoted.d
gas/testsuite/gas/i386/quoted.s