From cfaf27c37e3e5df5ca00a75758a36af870b5fb45 Mon Sep 17 00:00:00 2001 From: "hashimoto@chromium.org" Date: Tue, 27 Jan 2015 03:27:08 +0000 Subject: Stop calling memmove when unnecessary BUG=chromium:450137 R=mark@chromium.org git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1416 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/client/linux/minidump_writer/linux_ptrace_dumper.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/client/linux/minidump_writer/linux_ptrace_dumper.cc b/src/client/linux/minidump_writer/linux_ptrace_dumper.cc index 5ab59c27..95f12942 100644 --- a/src/client/linux/minidump_writer/linux_ptrace_dumper.cc +++ b/src/client/linux/minidump_writer/linux_ptrace_dumper.cc @@ -282,8 +282,10 @@ bool LinuxPtraceDumper::ThreadsSuspend() { // If the thread either disappeared before we could attach to it, or if // it was part of the seccomp sandbox's trusted code, it is OK to // silently drop it from the minidump. - my_memmove(&threads_[i], &threads_[i+1], - (threads_.size() - i - 1) * sizeof(threads_[i])); + if (i < threads_.size() - 1) { + my_memmove(&threads_[i], &threads_[i + 1], + (threads_.size() - i - 1) * sizeof(threads_[i])); + } threads_.resize(threads_.size() - 1); --i; } -- cgit v1.2.1