Hallo Eric, Hallo All,

if the "Software\\Wine\\WineDbg" registry branch doesn't exist,
DEBUG_IntVars[i].pval doesn't get initialised and dereferencing it
later with the DBG_IVAR() macro crashed.

What about making the DBG_IVAR macro only dereference non NULL
pointers like with the patch below?

I too think that either the DEBUG_IntVarsRW() branch with RegOpenKey()
failing should emit some warning or initialize the pointers.

It will make life easier for people who don't read the instructions
(like me) :-)

Bye

Uwe Bonnes                [EMAIL PROTECTED]

Free Software: If you contribute nothing, expect nothing
--
Index: wine/debugger/debugger.h
===================================================================
RCS file: /home/wine/wine/debugger/debugger.h,v
retrieving revision 1.8
diff -u -r1.8 debugger.h
--- wine/debugger/debugger.h    2000/04/30 12:21:15     1.8
+++ wine/debugger/debugger.h    2000/04/30 21:55:34
@@ -468,7 +468,7 @@
 
 #define  DBG_IVARNAME(_var)    DEBUG_IV_##_var
 #define  DBG_IVARSTRUCT(_var)  DEBUG_IntVars[DBG_IVARNAME(_var)]
-#define  DBG_IVAR(_var)                (*(DBG_IVARSTRUCT(_var).pval))
+#define  DBG_IVAR(_var)                
+(DBG_IVARSTRUCT(_var).pval)?(*(DBG_IVARSTRUCT(_var).pval)):0
 #define  INTERNAL_VAR(_var,_val,_ref,_typ) DBG_IVARNAME(_var),
 enum debug_int_var {
 #include "intvar.h"
Index: wine/debugger/debugger.h
===================================================================
RCS file: /home/wine/wine/debugger/debugger.h,v
retrieving revision 1.8
diff -u -r1.8 debugger.h
--- wine/debugger/debugger.h    2000/04/30 12:21:15     1.8
+++ wine/debugger/debugger.h    2000/04/30 21:55:48
@@ -468,7 +468,7 @@
 
 #define  DBG_IVARNAME(_var)    DEBUG_IV_##_var
 #define  DBG_IVARSTRUCT(_var)  DEBUG_IntVars[DBG_IVARNAME(_var)]
-#define  DBG_IVAR(_var)                (*(DBG_IVARSTRUCT(_var).pval))
+#define  DBG_IVAR(_var)                
+(DBG_IVARSTRUCT(_var).pval)?(*(DBG_IVARSTRUCT(_var).pval)):0
 #define  INTERNAL_VAR(_var,_val,_ref,_typ) DBG_IVARNAME(_var),
 enum debug_int_var {
 #include "intvar.h"

Reply via email to