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

Unified Diff: courgette/disassembler_elf_32.cc

Issue 613893002: Fix more MSVC warnings, courgette/ edition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: static_cast Created 6 years, 2 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 | « courgette/assembly_program.cc ('k') | courgette/disassembler_elf_32_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: courgette/disassembler_elf_32.cc
diff --git a/courgette/disassembler_elf_32.cc b/courgette/disassembler_elf_32.cc
index bfd1ef4acdcbad747095928b07e7f906a2149c60..ff2b9e03b611cc42717aa96a2e7525023696a242 100644
--- a/courgette/disassembler_elf_32.cc
+++ b/courgette/disassembler_elf_32.cc
@@ -405,16 +405,12 @@ CheckBool DisassemblerElf32::ParseSimpleRegion(
size_t start_file_offset,
size_t end_file_offset,
AssemblyProgram* program) {
-
- const uint8* start = OffsetToPointer(start_file_offset);
- const uint8* end = OffsetToPointer(end_file_offset);
-
// Callers don't guarantee start < end
- if (start >= end) return true;
+ if (start_file_offset >= end_file_offset) return true;
- const ptrdiff_t len = end - start; // Works because vars are byte pointers
+ const size_t len = end_file_offset - start_file_offset;
- if (!program->EmitBytesInstruction(start, len))
+ if (!program->EmitBytesInstruction(OffsetToPointer(start_file_offset), len))
return false;
return true;
« no previous file with comments | « courgette/assembly_program.cc ('k') | courgette/disassembler_elf_32_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698