https://sourceware.org/bugzilla/show_bug.cgi?id=30248

--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot 
gnu.org> ---
The master branch has been updated by Jan Beulich <jbeul...@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4f0813127bc0c525fca152bca4fea30b7490ae14

commit 4f0813127bc0c525fca152bca4fea30b7490ae14
Author: Jan Beulich <jbeul...@suse.com>
Date:   Wed Apr 19 11:43:26 2023 +0200

    x86: parse_register() must not alter the parsed string

    This reverts the code change done by 100f993c53a5 ("x86: Check
    unbalanced braces in memory reference"), which wrongly identified
    e87fb6a6d0cd ("x86/gas: support quoted address scale factor in AT&T
    syntax") as the root cause of PR gas/30248. (The testcase is left in
    place, no matter that it's at best marginally useful in that shape.)

    The problem instead is that parse_register() alters the string handed to
    it, thus breaking valid assumptions in subsequent parsing code. Since
    the function's behavior is a result of get_symbol_name()'s, make a copy
    of the incoming string before invoking that function.

    Like for parse_real_register() follow the model of strtol() et al: input
    string is const-qualified to signal that the string isn't altered, but
    the returned "end" pointer is not const-qualified, requiring const to be
    cast away (which generally is a bad idea, but the alternative would
    again be more convoluted code).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to