Commit faf2880f authored by Dave Hawkes's avatar Dave Hawkes Committed by Alexandre Julliard

Fix for some types of C++ debug info that can cause winedbg to crash.

parent 5446abe8
......@@ -540,13 +540,13 @@ union codeview_type
{
struct
{
short int len;
unsigned short int len;
short int id;
} generic;
struct
{
short int len;
unsigned short int len;
short int id;
short int attribute;
short int datatype;
......@@ -555,7 +555,7 @@ union codeview_type
struct
{
short int len;
unsigned short int len;
short int id;
unsigned int datatype;
unsigned int attribute;
......@@ -564,7 +564,7 @@ union codeview_type
struct
{
short int len;
unsigned short int len;
short int id;
unsigned char nbits;
unsigned char bitoff;
......@@ -573,7 +573,7 @@ union codeview_type
struct
{
short int len;
unsigned short int len;
short int id;
unsigned int type;
unsigned char nbits;
......@@ -582,7 +582,7 @@ union codeview_type
struct
{
short int len;
unsigned short int len;
short int id;
short int elemtype;
short int idxtype;
......@@ -594,7 +594,7 @@ union codeview_type
struct
{
short int len;
unsigned short int len;
short int id;
unsigned int elemtype;
unsigned int idxtype;
......@@ -606,7 +606,7 @@ union codeview_type
struct
{
short int len;
unsigned short int len;
short int id;
short int n_element;
short int fieldlist;
......@@ -621,7 +621,7 @@ union codeview_type
struct
{
short int len;
unsigned short int len;
short int id;
short int n_element;
short int property;
......@@ -636,7 +636,7 @@ union codeview_type
struct
{
short int len;
unsigned short int len;
short int id;
short int count;
short int fieldlist;
......@@ -649,7 +649,7 @@ union codeview_type
struct
{
short int len;
unsigned short int len;
short int id;
short int count;
short int property;
......@@ -662,7 +662,7 @@ union codeview_type
struct
{
short int len;
unsigned short int len;
short int id;
short int count;
short int type;
......@@ -673,7 +673,7 @@ union codeview_type
struct
{
short int len;
unsigned short int len;
short int id;
short int count;
short int property;
......@@ -684,7 +684,7 @@ union codeview_type
struct
{
short int len;
unsigned short int len;
short int id;
unsigned char list[1];
} fieldlist;
......@@ -1569,7 +1569,8 @@ DEBUG_AddCVType_Enum( unsigned int typeno, char *name, unsigned int fieldlist )
struct datatype *list = DEBUG_GetCVType( fieldlist );
if ( list )
DEBUG_CopyFieldlist( dt, list );
if(DEBUG_CopyFieldlist( dt, list ) == FALSE)
return FALSE;
return DEBUG_AddCVType( typeno, dt );
}
......@@ -1583,7 +1584,8 @@ DEBUG_AddCVType_Struct( unsigned int typeno, char *name, int structlen, unsigned
if ( list )
{
DEBUG_SetStructSize( dt, structlen );
DEBUG_CopyFieldlist( dt, list );
if(DEBUG_CopyFieldlist( dt, list ) == FALSE)
return FALSE;
}
return DEBUG_AddCVType( typeno, dt );
......
......@@ -569,8 +569,14 @@ DEBUG_SetStructSize(struct datatype * dt, int size)
int
DEBUG_CopyFieldlist(struct datatype * dt, struct datatype * dt2)
{
assert( dt->type == dt2->type && ((dt->type == DT_STRUCT) || (dt->type == DT_ENUM)));
if (!(dt->type == dt2->type && ((dt->type == DT_STRUCT) || (dt->type == DT_ENUM)))) {
DEBUG_Printf(DBG_CHN_MESG, "Error: Copyfield list mismatch (%d<>%d): ", dt->type, dt2->type);
DEBUG_PrintTypeCast(dt);
DEBUG_Printf(DBG_CHN_MESG, " ");
DEBUG_PrintTypeCast(dt2);
DEBUG_Printf(DBG_CHN_MESG, "\n");
return FALSE;
}
if( dt->type == DT_STRUCT )
{
......@@ -1024,6 +1030,12 @@ DEBUG_PrintTypeCast(const struct datatype * dt)
{
const char* name = "none";
if(dt == NULL)
{
DEBUG_Printf(DBG_CHN_MESG, "--invalid--");
return FALSE;
}
if( dt->name != NULL )
{
name = dt->name;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment