This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 1/4] Remove check for negative size.
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: John Baldwin <jhb at freebsd dot org>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Wed, 6 Jul 2016 09:14:03 +0100
- Subject: Re: [PATCH v2 1/4] Remove check for negative size.
- Authentication-results: sourceware.org; auth=none
- References: <20160701174036.90598-1-jhb@FreeBSD.org> <20160701174036.90598-2-jhb@FreeBSD.org>
On Fri, Jul 1, 2016 at 6:40 PM, John Baldwin <jhb@freebsd.org> wrote:
> Since CORE_ADDR is unsigned, this value can never be negative.
>
score7_malloc_and_get_memblock is called like this,
/* Allocate MEMBLOCK if PC - STARTADDR > 0. */
memblock_ptr = memblock =
score7_malloc_and_get_memblock (startaddr, pc - startaddr);
and startaddr is got by find_pc_partial_function
find_pc_partial_function (pc, NULL, &start_addr, NULL);
so pc >= startaddr, so size is >= 0. Your patch is right to me.
--
Yao (齐尧)