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

Side by Side Diff: src/disassembler.cc

Issue 2905643002: [arm] Fix memory leak in disassembler. (Closed)
Patch Set: Rename iterator. Created 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project 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 "src/disassembler.h" 5 #include "src/disassembler.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "src/assembler-inl.h" 9 #include "src/assembler-inl.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 } 258 }
259 259
260 // If this is a constant pool load and we haven't found any RelocInfo 260 // If this is a constant pool load and we haven't found any RelocInfo
261 // already, check if we can find some RelocInfo for the target address in 261 // already, check if we can find some RelocInfo for the target address in
262 // the constant pool. 262 // the constant pool.
263 if (pcs.is_empty() && converter.code() != nullptr) { 263 if (pcs.is_empty() && converter.code() != nullptr) {
264 RelocInfo dummy_rinfo(prev_pc, RelocInfo::NONE32, 0, nullptr); 264 RelocInfo dummy_rinfo(prev_pc, RelocInfo::NONE32, 0, nullptr);
265 if (dummy_rinfo.IsInConstantPool()) { 265 if (dummy_rinfo.IsInConstantPool()) {
266 byte* constant_pool_entry_address = 266 byte* constant_pool_entry_address =
267 dummy_rinfo.constant_pool_entry_address(); 267 dummy_rinfo.constant_pool_entry_address();
268 RelocIterator* it = new RelocIterator(converter.code()); 268 RelocIterator reloc_it(converter.code());
269 while (!it->done()) { 269 while (!reloc_it.done()) {
270 if (it->rinfo()->IsInConstantPool() && 270 if (reloc_it.rinfo()->IsInConstantPool() &&
271 (it->rinfo()->constant_pool_entry_address() == 271 (reloc_it.rinfo()->constant_pool_entry_address() ==
272 constant_pool_entry_address)) { 272 constant_pool_entry_address)) {
273 PrintRelocInfo(&out, isolate, ref_encoder, os, it->rinfo()); 273 PrintRelocInfo(&out, isolate, ref_encoder, os, reloc_it.rinfo());
274 break; 274 break;
275 } 275 }
276 it->next(); 276 reloc_it.next();
277 } 277 }
278 } 278 }
279 } 279 }
280 280
281 DumpBuffer(os, &out); 281 DumpBuffer(os, &out);
282 } 282 }
283 283
284 // Emit comments following the last instruction (if any). 284 // Emit comments following the last instruction (if any).
285 if (it != NULL) { 285 if (it != NULL) {
286 for ( ; !it->done(); it->next()) { 286 for ( ; !it->done(); it->next()) {
(...skipping 20 matching lines...) Expand all
307 307
308 int Disassembler::Decode(Isolate* isolate, std::ostream* os, byte* begin, 308 int Disassembler::Decode(Isolate* isolate, std::ostream* os, byte* begin,
309 byte* end, Code* code) { 309 byte* end, Code* code) {
310 return 0; 310 return 0;
311 } 311 }
312 312
313 #endif // ENABLE_DISASSEMBLER 313 #endif // ENABLE_DISASSEMBLER
314 314
315 } // namespace internal 315 } // namespace internal
316 } // namespace v8 316 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698