Fix polymorphic invokes (one more round).
memcpy() exhibits undefined behavior when the source and the
destination overlap. Use memmove() instead.
This fixes test failures when running the below tests on MIPS.
Test: booted MIPS32R2 in QEMU
Test: ./run-test --interpreter 953-invoke-polymorphic-compiler
Test: ./run-test --interpreter 955-methodhandles-smali
Test: ./run-test --interpreter 956-methodhandles
Test: ./run-test --interpreter 957-methodhandle-transforms
Test: ./run-test --interpreter 958-methodhandle-emulated-stackframe
Test: ./run-test --interpreter 959-invoke-polymorphic-accessors
Change-Id: Ia17ff25001faa7d91ce1178ab35313c36e75aa07
diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc
index 76777d9..28bcb97 100644
--- a/runtime/interpreter/interpreter_common.cc
+++ b/runtime/interpreter/interpreter_common.cc
@@ -596,7 +596,7 @@
// Get the register arguments for the invoke.
inst->GetVarArgs(args, inst_data);
// Drop the first register which is the method handle performing the invoke.
- memcpy(args, args + 1, sizeof(args[0]) * (Instruction::kMaxVarArgRegs - 1));
+ memmove(args, args + 1, sizeof(args[0]) * (Instruction::kMaxVarArgRegs - 1));
args[Instruction::kMaxVarArgRegs - 1] = 0;
return DoInvokePolymorphic<is_range, do_access_check>(self,
invoke_method,