aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-pdp11.c
diff options
context:
space:
mode:
authorStephen Casner <casner@acm.org>2020-05-27 18:40:38 -0700
committerStephen Casner <casner@acm.org>2020-05-27 18:40:38 -0700
commit1c912705af057b0d30ea51af46d8a00014a84034 (patch)
treec1ee20550f9f18c06ad31ae480c4440d76c3510f /gas/config/tc-pdp11.c
parent92eb6ed1779e5bb675d99b2be472021ac0703656 (diff)
downloadbinutils-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.c11
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;
}