From: Nick Clifton Date: Fri, 23 Feb 2018 11:10:42 +0000 (+0000) Subject: Import patch from mainline to fix memory corruption in MIPS assembler. X-Git-Tag: users/ARM/embedded-binutils-2_30-branch-2018q2~51 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e5ccef16d86f8e23715fb9c4b2dd794ff414962d;p=thirdparty%2Fbinutils-gdb.git Import patch from mainline to fix memory corruption in MIPS assembler. PR 22014 gas * config/tc-mips.c (mips_lookup_insn): Use memmove to strip the instruction size suffix. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 232d2469e4c..e9dcc019b04 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,13 @@ +2018-02-23 Nick Clifton + + * Import from mainline: + + 2018-02-22 A. Wilcox + + PR 22014 + * config/tc-mips.c (mips_lookup_insn): Use memmove to strip the + instruction size suffix. + 2018-02-16 Tamar Christina * config/tc-arm.c (cpu_arch_ver): Renumber ARM_ARCH_V8_4A. diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 97c9109c4fb..691fb335449 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -13956,7 +13956,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) {