summaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2011-04-13 13:20:21 +0000
committerNick Clifton <nickc@redhat.com>2011-04-13 13:20:21 +0000
commit95b157b72f76d3175a6a217039c09cbe827d47d9 (patch)
treed376d0bc1e238b6b9e702bee82a3cf298045cd45 /opcodes
parentcf9de0d7b580d7a37293817f0496183f3b7299e2 (diff)
downloadbinutils-redhat-95b157b72f76d3175a6a217039c09cbe827d47d9.tar.gz
* v850-dis.c (disassemble): Always print a closing square brace if
an opening square brace was printed.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog5
-rw-r--r--opcodes/v850-dis.c13
2 files changed, 15 insertions, 3 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 37151f90af..ad8570622c 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,8 @@
+2011-04-13 Nick Clifton <nickc@redhat.com>
+
+ * v850-dis.c (disassemble): Always print a closing square brace if
+ an opening square brace was printed.
+
2011-04-12 Nick Clifton <nickc@redhat.com>
PR binutils/12534
diff --git a/opcodes/v850-dis.c b/opcodes/v850-dis.c
index c3624b21f4..cf0d3860d3 100644
--- a/opcodes/v850-dis.c
+++ b/opcodes/v850-dis.c
@@ -283,6 +283,7 @@ disassemble (bfd_vma memaddr, struct disassemble_info *info, int bytes_read, uns
*opindex_ptr != 0;
opindex_ptr++, opnum++)
{
+ bfd_boolean square = FALSE;
long value;
int flag;
char *prefix;
@@ -323,11 +324,17 @@ disassemble (bfd_vma memaddr, struct disassemble_info *info, int bytes_read, uns
}
if (opnum == 1 && opnum == memop)
- info->fprintf_func (info->stream, "%s[", prefix);
+ {
+ info->fprintf_func (info->stream, "%s[", prefix);
+ square = TRUE;
+ }
else if (opnum > 1
&& (v850_operands[*(opindex_ptr - 1)].flags & V850_OPERAND_DISP) != 0
&& opnum == memop)
- info->fprintf_func (info->stream, "%s[", prefix);
+ {
+ info->fprintf_func (info->stream, "%s[", prefix);
+ square = TRUE;
+ }
else if (opnum > 1)
info->fprintf_func (info->stream, ", %s", prefix);
@@ -431,7 +438,7 @@ disassemble (bfd_vma memaddr, struct disassemble_info *info, int bytes_read, uns
break;
}
- if (opnum == 2 && opnum == memop)
+ if (square)
(*info->fprintf_func) (info->stream, "]");
}