Commit 0b5ceda4 authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[unwinder] Copy constructor cleanups

There were some cleanups to be done after crrev.com/c/v8/v8/+/2472000/
was merged.

Bug: v8:10799
Change-Id: I09bc2d123f89b88c74c3aecfa97c82d1925a1f2b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2488686Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70685}
parent cf1bb761
......@@ -11154,14 +11154,7 @@ RegisterState::RegisterState()
RegisterState::~RegisterState() = default;
RegisterState::RegisterState(const RegisterState& other) V8_NOEXCEPT {
pc = other.pc;
sp = other.sp;
fp = other.fp;
lr = other.lr;
if (other.callee_saved) {
callee_saved =
std::make_unique<CalleeSavedRegisters>(*(other.callee_saved));
}
*this = other;
}
RegisterState& RegisterState::operator=(const RegisterState& other)
......@@ -11172,8 +11165,12 @@ RegisterState& RegisterState::operator=(const RegisterState& other)
fp = other.fp;
lr = other.lr;
if (other.callee_saved) {
// Make a deep copy if {other.callee_saved} is non-null.
callee_saved =
std::make_unique<CalleeSavedRegisters>(*(other.callee_saved));
} else {
// Otherwise, set {callee_saved} to null to match {other}.
callee_saved.reset();
}
}
return *this;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment