[PATCH] compile-loc2c: Fix uninitialized variable error

Simon Marchi simon.marchi@polymtl.ca
Sun Jul 9 18:28:00 GMT 2017


On 2017-07-09 18:44, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:
> 
> Sorry about the delay on this.  I've been away.
> 
>>> * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Read
>>> address when op is DW_OP_addr.
> 
> Simon> As you are the original author of that code, would it be 
> possible for
> Simon> you to take a quick look, if you remember any of this :) ?
> 
> This patch looks correct to me.  I'm sure the earlier state was just an
> oversight.

Thanks! Pushing it now.

> FWIW in gimli's DWARF expression code, I separated the format decoder
> from the evaluator to avoid this sort of problem.  Each operation is
> decoded to an object; and then evaluation is done using the object.
> This isn't perfect, as different users of the decoded objects can still
> disagree about the semantics of the operation, but an approach like 
> this
> would have caught this bug.

Indeed, that sounds like a good design.

Simon



More information about the Gdb-patches mailing list