From fac749634521e085353fee7fe285fdbeffe1b6d8 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Sun, 29 Mar 2009 17:21:55 +0200 Subject: [PATCH] winedbg: Fix the way array derefs are done. --- programs/winedbg/types.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/programs/winedbg/types.c b/programs/winedbg/types.c index ef5469f199b..8d3dabc0186 100644 --- a/programs/winedbg/types.c +++ b/programs/winedbg/types.c @@ -310,26 +310,26 @@ BOOL types_array_index(const struct dbg_lvalue* lvalue, int index, DWORD64 length; if (!types_get_real_type(&type, &tag)) return FALSE; + /* Contents of array share same data (addr mode, module...) */ + *result = *lvalue; switch (tag) { case SymTagArrayType: types_get_info(&type, TI_GET_COUNT, &count); if (index < 0 || index >= count) return FALSE; - /* fall through */ + break; case SymTagPointerType: - /* Contents of array share same data (addr mode, module...) */ - *result = *lvalue; - /* - * Get the base type, so we know how much to index by. - */ - types_get_info(&type, TI_GET_TYPE, &result->type.id); - types_get_info(&result->type, TI_GET_LENGTH, &length); memory_read_value(lvalue, sizeof(result->addr.Offset), &result->addr.Offset); - result->addr.Offset += index * (DWORD)length; break; default: assert(FALSE); } + /* + * Get the base type, so we know how much to index by. + */ + types_get_info(&type, TI_GET_TYPE, &result->type.id); + types_get_info(&result->type, TI_GET_LENGTH, &length); + result->addr.Offset += index * (DWORD)length; return TRUE; }