This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
PATCH: fix stack underflow comparison in dwarf2expr.c
- From: Jim Blandy <jimb at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 17 Oct 2005 17:08:04 -0700
- Subject: PATCH: fix stack underflow comparison in dwarf2expr.c
Committed as obvious.
gdb/ChangeLog:
2005-10-17 Jim Blandy <jimb@redhat.com>
* dwarf2expr.c (dwarf_expr_fetch): Use correct comparison to
detect stack underflow.
Index: gdb/dwarf2expr.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2expr.c,v
retrieving revision 1.16
diff -c -p -r1.16 dwarf2expr.c
*** gdb/dwarf2expr.c 12 Jul 2005 13:06:54 -0000 1.16
--- gdb/dwarf2expr.c 18 Oct 2005 00:01:18 -0000
*************** dwarf_expr_pop (struct dwarf_expr_contex
*** 98,104 ****
CORE_ADDR
dwarf_expr_fetch (struct dwarf_expr_context *ctx, int n)
{
! if (ctx->stack_len < n)
error (_("Asked for position %d of stack, stack only has %d elements on it."),
n, ctx->stack_len);
return ctx->stack[ctx->stack_len - (1 + n)];
--- 98,104 ----
CORE_ADDR
dwarf_expr_fetch (struct dwarf_expr_context *ctx, int n)
{
! if (ctx->stack_len <= n)
error (_("Asked for position %d of stack, stack only has %d elements on it."),
n, ctx->stack_len);
return ctx->stack[ctx->stack_len - (1 + n)];