public inbox for gdb-testers@sourceware.org help / color / mirror / Atom feed
From: gdb-buildbot@sergiodj.net To: gdb-testers@sourceware.org Subject: [binutils-gdb] NS32K arg_bufs uninitialised Date: Mon, 06 Apr 2020 07:24:31 -0400 [thread overview] Message-ID: <03704c7704870a0e6cbb0eae99488d544c4adb30@gdb-build> (raw) *** TEST RESULTS FOR COMMIT 03704c7704870a0e6cbb0eae99488d544c4adb30 *** commit 03704c7704870a0e6cbb0eae99488d544c4adb30 Author: Alan Modra <amodra@gmail.com> AuthorDate: Sun Mar 22 18:15:41 2020 +1030 Commit: Alan Modra <amodra@gmail.com> CommitDate: Sun Mar 22 23:22:13 2020 +1030 NS32K arg_bufs uninitialised git commit d1e304bc27 was aimed at stopping uninitialised memory access to the index_offset array. Unfortunately that patch resulted in a different array being uninitialised for all instructions with more than two arguments. * ns32k-dis.c (print_insn_arg): Update comment. (print_insn_ns32k): Reduce size of index_offset array, and initialize, passing -1 to print_insn_arg for args that are not an index. Don't exit arg loop early. Abort on bad arg number. diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 7ca7a644cd..06b81d7b54 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,10 @@ +2020-03-22 Alan Modra <amodra@gmail.com> + + * ns32k-dis.c (print_insn_arg): Update comment. + (print_insn_ns32k): Reduce size of index_offset array, and + initialize, passing -1 to print_insn_arg for args that are not + an index. Don't exit arg loop early. Abort on bad arg number. + 2020-03-22 Alan Modra <amodra@gmail.com> * s12z-dis.c (abstract_read_memory): Don't print error on EOI. diff --git a/opcodes/ns32k-dis.c b/opcodes/ns32k-dis.c index d505edd774..12df182d0a 100644 --- a/opcodes/ns32k-dis.c +++ b/opcodes/ns32k-dis.c @@ -446,7 +446,7 @@ invalid_float (float_type_u *p, int len) bit position of the addressing extension. BUFFER contains the instruction. ADDR is where BUFFER was read from. Put the disassembled version of the operand in RESULT. INDEX_OFFSET is the bit position - of the index byte (it contains garbage if this operand is not a + of the index byte (it contains -1 if this operand is not a general operand using scaled indexed addressing mode). */ static int @@ -790,10 +790,8 @@ print_insn_ns32k (bfd_vma memaddr, disassemble_info *info) if (*d) { /* Offset in bits of the first thing beyond each index byte. - Element 0 is for operand A and element 1 is for operand B. - The rest are irrelevant, but we put them here so we don't - index outside the array. */ - int index_offset[MAX_ARGS]; + Element 0 is for operand A and element 1 is for operand B. */ + int index_offset[2]; /* 0 for operand A, 1 for operand B, greater for other args. */ int whicharg = 0; @@ -806,6 +804,8 @@ print_insn_ns32k (bfd_vma memaddr, disassemble_info *info) if we are using scaled indexed addressing mode, since the index bytes occur right after the basic instruction, not as part of the addressing extension. */ + index_offset[0] = -1; + index_offset[1] = -1; if (Is_gen (d[1])) { int bitoff = d[1] == 'f' ? 10 : 5; @@ -832,15 +832,16 @@ print_insn_ns32k (bfd_vma memaddr, disassemble_info *info) while (*d) { argnum = *d - '1'; + if (argnum >= MAX_ARGS) + abort (); d++; - if (argnum > maxarg && argnum < MAX_ARGS) + if (argnum > maxarg) maxarg = argnum; ioffset = print_insn_arg (*d, ioffset, &aoffset, buffer, memaddr, arg_bufs[argnum], - index_offset[whicharg]); + whicharg > 1 ? -1 : index_offset[whicharg]); d++; - if (whicharg++ >= 1) - break; + whicharg++; } for (argnum = 0; argnum <= maxarg; argnum++)
next reply other threads:[~2020-04-06 11:24 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-04-06 11:24 gdb-buildbot [this message] 2020-04-06 11:24 ` Failures on Fedora-x86_64-cc-with-index, branch master gdb-buildbot 2020-04-06 11:32 ` Failures on Fedora-i686, " gdb-buildbot 2020-04-06 12:21 ` Failures on Fedora-x86_64-m64, " gdb-buildbot 2020-04-06 12:35 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot 2020-04-06 13:16 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot 2020-04-10 2:25 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot 2020-04-10 20:45 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot 2020-04-11 21:20 ` Failures on Ubuntu-Aarch64-native-gdbserver-m64, " gdb-buildbot
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=03704c7704870a0e6cbb0eae99488d544c4adb30@gdb-build \ --to=gdb-buildbot@sergiodj.net \ --cc=gdb-testers@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).