Eric Pouech : winedbg: Fix 32bit displacement sign extension.

Alexandre Julliard julliard at winehq.org
Thu Feb 4 11:11:00 CST 2010


Module: wine
Branch: master
Commit: 4b8b07834444d700146bfc74c02ae4f546a8da26
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4b8b07834444d700146bfc74c02ae4f546a8da26

Author: Eric Pouech <eric.pouech at orange.fr>
Date:   Wed Feb  3 21:47:28 2010 +0100

winedbg: Fix 32bit displacement sign extension.

---

 programs/winedbg/db_disasm64.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/programs/winedbg/db_disasm64.c b/programs/winedbg/db_disasm64.c
index a11ad1f..cb1a174 100644
--- a/programs/winedbg/db_disasm64.c
+++ b/programs/winedbg/db_disasm64.c
@@ -1205,6 +1205,7 @@ db_disasm(db_addr_t loc, boolean_t altfmt)
 	long	imm64;
 	int	len;
 	struct i_addr	address;
+        db_addr_t addr;
 
 	get_value_inc(inst, loc, 1, FALSE);
 	short_addr = FALSE;
@@ -1528,19 +1529,19 @@ db_disasm(db_addr_t loc, boolean_t altfmt)
 
 		case Db:
 		    get_value_inc(displ, loc, 1, TRUE);
-		    displ += loc;
+		    addr = loc + (LONG64)displ;
 		    if (size == WORD)
-			displ &= 0xFFFF;
-		    db_printsym((db_addr_t)displ, DB_STGY_XTRN);
+			addr &= 0xFFFF;
+		    db_printsym(addr, DB_STGY_XTRN);
 		    break;
 
 		case Dl:
 		    len = db_lengths[(size == LONG && (rex & REX_W)) ? QUAD : size];
 		    get_value_inc(displ, loc, len, FALSE);
-		    displ += loc;
+		    addr = loc + (LONG64)displ;
 		    if (size == WORD)
-			displ &= 0xFFFF;
-		    db_printsym((db_addr_t)displ, DB_STGY_XTRN);
+			addr &= 0xFFFF;
+		    db_printsym(addr, DB_STGY_XTRN);
 		    break;
 
 		case o1:




More information about the wine-cvs mailing list