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 v2 1/4] Remove check for negative size.


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 (齐尧)


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