Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(417)

Side by Side Diff: courgette/disassembler_elf_32_x86.cc

Issue 1969543002: Unified usage of vector<unique_ptr<T>> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "courgette/disassembler_elf_32_x86.h" 5 #include "courgette/disassembler_elf_32_x86.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
huangs 2016/05/11 04:49:23 #include <utility> for std::move().
etiennep 2016/05/11 18:19:13 Done.
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "courgette/assembly_program.h" 11 #include "courgette/assembly_program.h"
12 #include "courgette/courgette.h" 12 #include "courgette/courgette.h"
13 13
14 namespace courgette { 14 namespace courgette {
15 15
16 CheckBool DisassemblerElf32X86::TypedRVAX86::ComputeRelativeTarget( 16 CheckBool DisassemblerElf32X86::TypedRVAX86::ComputeRelativeTarget(
17 const uint8_t* op_pointer) { 17 const uint8_t* op_pointer) {
18 set_relative_target(Read32LittleEndian(op_pointer) + 4); 18 set_relative_target(Read32LittleEndian(op_pointer) + 4);
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 } 178 }
179 } 179 }
180 180
181 std::unique_ptr<TypedRVAX86> typed_rel32_rva(new TypedRVAX86(rel32_rva)); 181 std::unique_ptr<TypedRVAX86> typed_rel32_rva(new TypedRVAX86(rel32_rva));
182 if (!typed_rel32_rva->ComputeRelativeTarget(rel32)) 182 if (!typed_rel32_rva->ComputeRelativeTarget(rel32))
183 return false; 183 return false;
184 184
185 RVA target_rva = typed_rel32_rva->rva() + 185 RVA target_rva = typed_rel32_rva->rva() +
186 typed_rel32_rva->relative_target(); 186 typed_rel32_rva->relative_target();
187 if (IsValidTargetRVA(target_rva)) { 187 if (IsValidTargetRVA(target_rva)) {
188 rel32_locations_.push_back(typed_rel32_rva.release()); 188 rel32_locations_.push_back(std::move(typed_rel32_rva));
189 #if COURGETTE_HISTOGRAM_TARGETS 189 #if COURGETTE_HISTOGRAM_TARGETS
190 ++rel32_target_rvas_[target_rva]; 190 ++rel32_target_rvas_[target_rva];
191 #endif 191 #endif
192 p = rel32 + 4; 192 p = rel32 + 4;
193 continue; 193 continue;
194 } 194 }
195 } 195 }
196 p += 1; 196 p += 1;
197 } 197 }
198 198
199 return true; 199 return true;
200 } 200 }
201 201
202 } // namespace courgette 202 } // namespace courgette
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698