mirror of
https://github.com/reactos/wine.git
synced 2024-11-24 20:30:01 +00:00
- Explicit init of rtn.cookie in DEBUG_EvalExpr to bad value to
expose further bad code - Print of pointer used as array now works
This commit is contained in:
parent
1fb3298e7b
commit
856aefa240
@ -55,6 +55,7 @@ typedef struct
|
||||
|
||||
#define DV_TARGET 0xF00D
|
||||
#define DV_HOST 0x50DA
|
||||
#define DV_INVALID 0x0000
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -302,6 +302,7 @@ DBG_VALUE DEBUG_EvalExpr(struct expr * exp)
|
||||
struct datatype * type2;
|
||||
|
||||
rtn.type = NULL;
|
||||
rtn.cookie = DV_INVALID;
|
||||
rtn.addr.off = 0;
|
||||
rtn.addr.seg = 0;
|
||||
|
||||
|
@ -761,13 +761,23 @@ DEBUG_ArrayIndex(const DBG_VALUE * value, DBG_VALUE * result, int index)
|
||||
*/
|
||||
size = DEBUG_GetObjectSize(value->type->un.pointer.pointsto);
|
||||
result->type = value->type->un.pointer.pointsto;
|
||||
result->addr.off = (*(unsigned int*) (value->addr.off)) + size * index;
|
||||
result->addr.off = (DWORD)DEBUG_ReadMemory(value) + size*index;
|
||||
|
||||
/* Contents of array must be on same target */
|
||||
result->cookie = value->cookie;
|
||||
}
|
||||
else if (value->type->type == DT_ARRAY)
|
||||
{
|
||||
size = DEBUG_GetObjectSize(value->type->un.array.basictype);
|
||||
result->type = value->type->un.array.basictype;
|
||||
result->addr.off = value->addr.off + size * (index - value->type->un.array.start);
|
||||
|
||||
/* Contents of array must be on same target */
|
||||
result->cookie = value->cookie;
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(FALSE);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
Loading…
Reference in New Issue
Block a user