aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-sh.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2023-08-02 09:23:36 +0100
committerNick Clifton <nickc@redhat.com>2023-08-02 09:23:36 +0100
commit675b9d612cc59446e84e2c6d89b45500cb603a8d (patch)
treead4ae6b4b1f1f81aceb945f15c5c12ea2b379689 /gas/config/tc-sh.c
parent69c37f53e20dc3e0b3c179b511ff786db6ae114e (diff)
downloadgdb-675b9d612cc59446e84e2c6d89b45500cb603a8d.zip
gdb-675b9d612cc59446e84e2c6d89b45500cb603a8d.tar.gz
gdb-675b9d612cc59446e84e2c6d89b45500cb603a8d.tar.bz2
2.41 Release sourcesbinutils-2_41-release
Diffstat (limited to 'gas/config/tc-sh.c')
-rw-r--r--gas/config/tc-sh.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c
index 634d5dc..bc0380a 100644
--- a/gas/config/tc-sh.c
+++ b/gas/config/tc-sh.c
@@ -1222,10 +1222,6 @@ static char *
get_operands (sh_opcode_info *info, char *args, sh_operand_info *operand)
{
char *ptr = args;
-
- operand[0].type = 0;
- operand[1].type = 0;
- operand[2].type = 0;
if (info->arg[0])
{
/* The pre-processor will eliminate whitespace in front of '@'
@@ -1238,7 +1234,9 @@ get_operands (sh_opcode_info *info, char *args, sh_operand_info *operand)
if (info->arg[1])
{
if (*ptr == ',')
- ptr++;
+ {
+ ptr++;
+ }
get_operand (&ptr, operand + 1);
/* ??? Hack: psha/pshl have a varying operand number depending on
the type of the first operand. We handle this by having the
@@ -1249,11 +1247,28 @@ get_operands (sh_opcode_info *info, char *args, sh_operand_info *operand)
if (info->arg[2] && operand[0].type != A_IMM)
{
if (*ptr == ',')
- ptr++;
+ {
+ ptr++;
+ }
get_operand (&ptr, operand + 2);
}
+ else
+ {
+ operand[2].type = 0;
+ }
+ }
+ else
+ {
+ operand[1].type = 0;
+ operand[2].type = 0;
}
}
+ else
+ {
+ operand[0].type = 0;
+ operand[1].type = 0;
+ operand[2].type = 0;
+ }
return ptr;
}