Commit 884c98b0 authored by rogerm's avatar rogerm Committed by Commit bot

Dereference and std::move in same param list == top crasher

Fix a top crasher (2016/10/20) caused by defer of a unique_ptr and a std::move of the same unique_ptr in the same parameter list. The order of evalulation is unspecified, so this is unsafe.

BUG=657778
R=ajha@chromium.org, avi@chromium.org

Review-Url: https://chromiumcodereview.appspot.com/2437123002
Cr-Commit-Position: refs/heads/master@{#426553}
parent 5238f251
...@@ -408,8 +408,8 @@ bool AutofillWalletMetadataSyncableService::GetLocalData( ...@@ -408,8 +408,8 @@ bool AutofillWalletMetadataSyncableService::GetLocalData(
AutofillTable::FromWebDatabase(web_data_backend_->GetDatabase()) AutofillTable::FromWebDatabase(web_data_backend_->GetDatabase())
->GetServerProfiles(&profile_list); ->GetServerProfiles(&profile_list);
while (!profile_list.empty()) { while (!profile_list.empty()) {
profiles->add(GetServerId(*profile_list.front()), auto server_id = GetServerId(*profile_list.front());
std::move(profile_list.front())); profiles->add(server_id, std::move(profile_list.front()));
profile_list.erase(profile_list.begin()); profile_list.erase(profile_list.begin());
} }
......
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