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

Side by Side Diff: courgette/disassembler_elf_32_x86.cc

Issue 2771753004: [Courgette] Refactor: Unify Disassembler::Disassemble() and instantiate AssemblyProgram there. (Closed)
Patch Set: Fix signed/unsigned comparison issue in test. Created 3 years, 9 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 | « courgette/disassembler_elf_32_arm.cc ('k') | courgette/disassembler_elf_32_x86_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 uint32_t section_relocs_count = 100 uint32_t section_relocs_count =
101 section_header->sh_size / section_header->sh_entsize; 101 section_header->sh_size / section_header->sh_entsize;
102 102
103 if (abs32_locations_.empty()) 103 if (abs32_locations_.empty())
104 match = false; 104 match = false;
105 105
106 if (abs32_locations_.size() > section_relocs_count) 106 if (abs32_locations_.size() > section_relocs_count)
107 match = false; 107 match = false;
108 108
109 std::vector<RVA>::iterator reloc_iter = abs32_locations_.begin(); 109 std::vector<RVA>::const_iterator reloc_iter = abs32_locations_.begin();
110 110
111 while (match && (reloc_iter != abs32_locations_.end())) { 111 while (match && (reloc_iter != abs32_locations_.end())) {
112 if (section_relocs_iter->r_info != R_386_RELATIVE || 112 if (section_relocs_iter->r_info != R_386_RELATIVE ||
113 section_relocs_iter->r_offset != *reloc_iter) { 113 section_relocs_iter->r_offset != *reloc_iter) {
114 match = false; 114 match = false;
115 } 115 }
116 ++section_relocs_iter; 116 ++section_relocs_iter;
117 ++reloc_iter; 117 ++reloc_iter;
118 } 118 }
119 119
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
« no previous file with comments | « courgette/disassembler_elf_32_arm.cc ('k') | courgette/disassembler_elf_32_x86_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698