Minor dlls/dbghelp/dwarf.c simplification
Eric Pouech
eric.pouech at orange.fr
Sat Apr 24 05:38:25 CDT 2010
Gerald Pfeifer a écrit :
> ChangeLog:
> Remove two variables which are not really used in
> dwarf2_parse_line_numbers.
>
> diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c
> index 4be0f6a..69d7357 100644
> --- a/dlls/dbghelp/dwarf.c
> +++ b/dlls/dbghelp/dwarf.c
> @@ -1920,7 +1920,7 @@ static BOOL dwarf2_parse_line_numbers(const dwarf2_section_t* sections,
> {
> dwarf2_traverse_context_t traverse;
> unsigned long length;
> - unsigned version, header_len, insn_size, default_stmt;
> + unsigned insn_size, default_stmt;
> unsigned line_range, opcode_base;
> int line_base;
> const unsigned char* opcode_len;
> @@ -1939,8 +1939,6 @@ static BOOL dwarf2_parse_line_numbers(const dwarf2_section_t* sections,
> length = dwarf2_parse_u4(&traverse);
> traverse.end_data = sections[section_line].address + offset + length;
>
> - version = dwarf2_parse_u2(&traverse);
> - header_len = dwarf2_parse_u4(&traverse);
> insn_size = dwarf2_parse_byte(&traverse);
> default_stmt = dwarf2_parse_byte(&traverse);
> line_base = (signed char)dwarf2_parse_byte(&traverse);
>
>
>
>
>
this is wrong: dwarf_parse family set makes the pointer in the cxt
advance by the size of the object which is being parse
and actually, the correct fix would be to make use of those variables
(like checking if the version is a known one), instead of throwing
things away
A+
--
Eric Pouech
"The problem with designing something completely foolproof is to underestimate the ingenuity of a complete idiot." (Douglas Adams)
More information about the wine-devel
mailing list