This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
[dw-op-value] fix a bad compare
- From: Tom Tromey <tromey at redhat dot com>
- To: Project Archer <archer at sourceware dot org>
- Date: Wed, 02 Sep 2009 15:10:38 -0600
- Subject: [dw-op-value] fix a bad compare
- Reply-to: Tom Tromey <tromey at redhat dot com>
I ran into this bug when writing a test case for submitting this branch
upstream.
There was an incorrect comparison in the code, causing us to reject
certain expressions.
Tom
2009-09-02 Tom Tromey <tromey@redhat.com>
* dwarf2expr.c (execute_stack_op) <DW_OP_implicit_value>: Fix
test.
diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c
index a673939..7b788b9 100644
--- a/gdb/dwarf2expr.c
+++ b/gdb/dwarf2expr.c
@@ -456,7 +456,7 @@ execute_stack_op (struct dwarf_expr_context *ctx,
{
ULONGEST len;
op_ptr = read_uleb128 (op_ptr, op_end, &len);
- if (op_ptr + len >= op_end)
+ if (op_ptr + len > op_end)
error (_("DW_OP_implicit_value: too few bytes available."));
ctx->len = len;
ctx->data = op_ptr;