summaryrefslogtreecommitdiffstats
path: root/courgette/disassembler_win32_x64.cc
diff options
context:
space:
mode:
authorpkasting <pkasting@chromium.org>2014-10-03 11:52:29 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-03 18:52:42 +0000
commit8e3a26aaf2392d784ba6d5cbb696da926230a722 (patch)
treec6556382e51d205e9d704072e8b07c007d8bc651 /courgette/disassembler_win32_x64.cc
parent1bd4f75c6522dc81b8ba30ca4174e2c312c43d83 (diff)
downloadchromium_src-8e3a26aaf2392d784ba6d5cbb696da926230a722.zip
chromium_src-8e3a26aaf2392d784ba6d5cbb696da926230a722.tar.gz
chromium_src-8e3a26aaf2392d784ba6d5cbb696da926230a722.tar.bz2
Fix more MSVC warnings, courgette/ edition.
This is mostly about changing types and inserting casts so as to avoid implicit value truncations. BUG=81439 TEST=none Review URL: https://codereview.chromium.org/613893002 Cr-Commit-Position: refs/heads/master@{#298069}
Diffstat (limited to 'courgette/disassembler_win32_x64.cc')
-rw-r--r--courgette/disassembler_win32_x64.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/courgette/disassembler_win32_x64.cc b/courgette/disassembler_win32_x64.cc
index 1da5951..04356d7 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)))