]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix memory access violation when attempting to shorten a suffixed micromips instructi...
authorA. Wilcox <awilfox@adelielinux.org>
Thu, 22 Feb 2018 12:49:49 +0000 (12:49 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 22 Feb 2018 12:49:49 +0000 (12:49 +0000)
PR 22014
* config/tc-mips.c (mips_lookup_insn): Use memmove to strip the
instruction size suffix.

gas/ChangeLog
gas/config/tc-mips.c

index 07e357486110e134fa1d01a937821ce97525be65..ce7e2585950a380bbb07d86c116ab0cba236b85f 100644 (file)
@@ -1,3 +1,9 @@
+2018-02-22  A. Wilcox  <awilfox@adelielinux.org>
+
+       PR 22014
+       * config/tc-mips.c (mips_lookup_insn): Use memmove to strip the
+       instruction size suffix.
+
 2018-02-20  Maciej W. Rozycki  <macro@mips.com>
 
        * testsuite/gas/mips/mips16-branch-reloc-4.d: New test.
index fca0dea8dc45cc98731c83a5762217643be4cce9..6c68395094cc1a0900001ed30e29e69f937b51cd 100644 (file)
@@ -13955,7 +13955,7 @@ mips_lookup_insn (struct hash_control *hash, const char *start,
        suffix = 0;
       if (suffix)
        {
-         memcpy (name + opend - 2, name + opend, length - opend + 1);
+         memmove (name + opend - 2, name + opend, length - opend + 1);
          insn = (struct mips_opcode *) hash_find (hash, name);
          if (insn)
            {