From ef0fdf07a40a2097075d60d745150408f0ea9c30 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Tue, 18 Oct 2005 00:04:11 +0000 Subject: [PATCH] 2005-10-17 Jim Blandy * dwarf2expr.c (dwarf_expr_fetch): Use correct comparison to detect stack underflow. --- gdb/ChangeLog | 5 +++++ gdb/dwarf2expr.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0702a657a29..37bbf05da9d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2005-10-17 Jim Blandy + + * dwarf2expr.c (dwarf_expr_fetch): Use correct comparison to + detect stack underflow. + 2005-10-14 Paul Gilliam * rs6000-tdep.c (rs6000_register_reggroup_p): Add vscr to test for diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c index e75dcee6beb..1296633a453 100644 --- a/gdb/dwarf2expr.c +++ b/gdb/dwarf2expr.c @@ -98,7 +98,7 @@ dwarf_expr_pop (struct dwarf_expr_context *ctx) CORE_ADDR dwarf_expr_fetch (struct dwarf_expr_context *ctx, int n) { - if (ctx->stack_len < 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)]; -- 2.30.2