From e5ccef16d86f8e23715fb9c4b2dd794ff414962d Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 23 Feb 2018 11:10:42 +0000 Subject: [PATCH] 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. --- gas/ChangeLog | 10 ++++++++++ gas/config/tc-mips.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) 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) { -- 2.47.3