diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2001-12-20 17:28:13 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@redhat.com> | 2001-12-20 17:28:13 +0000 |
commit | 8d4d84c202991e99b753fafd5e3d063fb0b9dc75 (patch) | |
tree | ea85421ef5eb6aacce85ba3f349c67bdedb234e7 /gas/config | |
parent | 2c283bc467fffc9faee414a6208735073b70716a (diff) | |
download | gdb-8d4d84c202991e99b753fafd5e3d063fb0b9dc75.zip gdb-8d4d84c202991e99b753fafd5e3d063fb0b9dc75.tar.gz gdb-8d4d84c202991e99b753fafd5e3d063fb0b9dc75.tar.bz2 |
* config/tc-sh.c (parse_at): Reject @(r0) and @(r0,).
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-sh.c | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c index a238019..27c33cd 100644 --- a/gas/config/tc-sh.c +++ b/gas/config/tc-sh.c @@ -914,7 +914,7 @@ parse_at (src, op) else if (src[0] == '(') { /* Could be @(disp, rn), @(disp, gbr), @(disp, pc), @(r0, gbr) or - @(r0, rn) */ + @(r0, rn). */ src++; len = parse_reg (src, &mode, &(op->reg)); if (len && mode == A_REG_N) @@ -925,29 +925,42 @@ parse_at (src, op) as_bad (_("must be @(r0,...)")); } if (src[0] == ',') - src++; - /* Now can be rn or gbr */ - len = parse_reg (src, &mode, &(op->reg)); - if (mode == A_GBR) { - op->type = A_R0_GBR; + src++; + /* Now can be rn or gbr. */ + len = parse_reg (src, &mode, &(op->reg)); + } + else + { + len = 0; } - else if (mode == A_REG_N) + if (len) { - op->type = A_IND_R0_REG_N; + if (mode == A_GBR) + { + op->type = A_R0_GBR; + } + else if (mode == A_REG_N) + { + op->type = A_IND_R0_REG_N; + } + else + { + as_bad (_("syntax error in @(r0,...)")); + } } else { - as_bad (_("syntax error in @(r0,...)")); + as_bad (_("syntax error in @(r0...)")); } } else { - /* Must be an @(disp,.. thing) */ + /* Must be an @(disp,.. thing). */ src = parse_exp (src, op); if (src[0] == ',') src++; - /* Now can be rn, gbr or pc */ + /* Now can be rn, gbr or pc. */ len = parse_reg (src, &mode, &op->reg); if (len) { |