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

Unified Diff: courgette/disassembler_win32_x64.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/disassembler_elf_32_arm.cc ('k') | courgette/encoded_program.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: courgette/disassembler_win32_x64.cc
diff --git a/courgette/disassembler_win32_x64.cc b/courgette/disassembler_win32_x64.cc
index 1da5951c4359135adf72db4a122933c3da69fa97..04356d7f23317cbaf3aa29f3de480f58cba68e48 100644
--- a/courgette/disassembler_win32_x64.cc
+++ b/courgette/disassembler_win32_x64.cc
@@ -573,7 +573,9 @@ CheckBool DisassemblerWin32X64::ParseFileRegion(
if (abs32_pos != abs32_locations_.end() && *abs32_pos == current_rva) {
uint32 target_address = Read32LittleEndian(p);
- RVA target_rva = target_address - image_base();
+ // TODO(wfh): image_base() can be larger than 32 bits, so this math can
+ // underflow. Figure out the right solution here.
+ RVA target_rva = target_address - static_cast<uint32>(image_base());
// TODO(sra): target could be Label+offset. It is not clear how to guess
// which it might be. We assume offset==0.
if (!program->EmitAbs32(program->FindOrMakeAbs32Label(target_rva)))
« no previous file with comments | « courgette/disassembler_elf_32_arm.cc ('k') | courgette/encoded_program.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698