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

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: Created 6 years, 3 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
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)))

Powered by Google App Engine
This is Rietveld 408576698