summaryrefslogtreecommitdiff
path: root/bfd/cpu-h8300.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2023-04-19 11:43:26 +0200
committerJan Beulich <jbeulich@suse.com>2023-04-19 11:43:26 +0200
commit4f0813127bc0c525fca152bca4fea30b7490ae14 (patch)
tree90696f41851a2c27dee47644cbac5fe6057449bc /bfd/cpu-h8300.c
parent74e05e01e2de46dc817d747c646421125e59d6b1 (diff)
downloadbinutils-gdb-4f0813127bc0c525fca152bca4fea30b7490ae14.tar.gz
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).
Diffstat (limited to 'bfd/cpu-h8300.c')
0 files changed, 0 insertions, 0 deletions