Index: courgette/disassembler_win32_x64.cc |
diff --git a/courgette/disassembler_win32_x64.cc b/courgette/disassembler_win32_x64.cc |
index 1da5951c4359135adf72db4a122933c3da69fa97..4cc515a9522b90ee8a3cfcd4e8469efeef424b18 100644 |
--- a/courgette/disassembler_win32_x64.cc |
+++ b/courgette/disassembler_win32_x64.cc |
@@ -573,7 +573,8 @@ 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(); |
+ // !!! Is this cast safe? |
Peter Kasting
2014/09/30 00:08:01
This question must be answered before this change
dgarrett
2014/10/01 20:49:37
There were repeated assurances that it is safe for
Peter Kasting
2014/10/01 22:12:05
OK. I implemented this by way of a checked_cast<>
|
+ 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))) |