diff options
author | Stephen Casner <casner@acm.org> | 2020-05-27 18:40:38 -0700 |
---|---|---|
committer | Stephen Casner <casner@acm.org> | 2020-05-27 18:40:38 -0700 |
commit | 1c912705af057b0d30ea51af46d8a00014a84034 (patch) | |
tree | c1ee20550f9f18c06ad31ae480c4440d76c3510f /gas/config/tc-pdp11.c | |
parent | 92eb6ed1779e5bb675d99b2be472021ac0703656 (diff) | |
download | binutils-1c912705af057b0d30ea51af46d8a00014a84034.zip binutils-1c912705af057b0d30ea51af46d8a00014a84034.tar.gz binutils-1c912705af057b0d30ea51af46d8a00014a84034.tar.bz2 |
Fix PR gas/26001 (pdp11-*-*)
PR gas/26001
* gas/config/tc-pdp11.c (parse_reg): Distinguish register names from
symbols that begin with a register name.
* gas/testsuite/gas/pdp11/pdp11.exp: Add test of such symbols.
* gas/testsuite/gas/pdp11/pr26001.s: Likewise.
* gas/testsuite/gas/pdp11/pr26001.d: Likewise.
Diffstat (limited to 'gas/config/tc-pdp11.c')
-rw-r--r-- | gas/config/tc-pdp11.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gas/config/tc-pdp11.c b/gas/config/tc-pdp11.c index d38a3cd..57daa0f 100644 --- a/gas/config/tc-pdp11.c +++ b/gas/config/tc-pdp11.c @@ -358,8 +358,17 @@ parse_reg (char *str, struct pdp11_code *operand) str += 2; } else - operand->error = _("Bad register name"); + { + operand->error = _("Bad register name"); + return str; + } + if (ISALNUM (*str) || *str == '_' || *str == '.') + { + operand->error = _("Bad register name"); + str -= 2; + } + return str; } |