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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/disassembler.cc
diff --git a/src/disassembler.cc b/src/disassembler.cc
index 8f0f758e6d9e8d6201df827a13eb68fb71ddb0ef..05631166c7d379073b5f59a8ccbbcf4004cba097 100644
--- a/src/disassembler.cc
+++ b/src/disassembler.cc
@@ -265,15 +265,15 @@ static int DecodeIt(Isolate* isolate, std::ostream* os,
if (dummy_rinfo.IsInConstantPool()) {
byte* constant_pool_entry_address =
dummy_rinfo.constant_pool_entry_address();
- RelocIterator* it = new RelocIterator(converter.code());
- while (!it->done()) {
- if (it->rinfo()->IsInConstantPool() &&
- (it->rinfo()->constant_pool_entry_address() ==
+ RelocIterator reloc_it(converter.code());
+ while (!reloc_it.done()) {
+ if (reloc_it.rinfo()->IsInConstantPool() &&
+ (reloc_it.rinfo()->constant_pool_entry_address() ==
constant_pool_entry_address)) {
- PrintRelocInfo(&out, isolate, ref_encoder, os, it->rinfo());
+ PrintRelocInfo(&out, isolate, ref_encoder, os, reloc_it.rinfo());
break;
}
- it->next();
+ reloc_it.next();
}
}
}
« 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