This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] compile-loc2c: Fix uninitialized variable error


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]