This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [committed] Fix assert in gimple_phi_arg


On Wed, Jul 19, 2017 at 5:42 PM, Tom de Vries <Tom_deVries@mentor.com> wrote:
> Hi,
>
> this patch makes an assert in gimple_phi_arg more strict.
>
> The current assert allows 'index == phi_stmt->capacity', but
> 'phi_stmt->args[phi_stmt->capacity]' is out of bounds.
>
> Bootstrapped and reg-tested on x86_64.
>
> Committed as obvious.

Hmm, shouldn't it be index < phi_stmt->nargs?  See gimple_phi_set_arg
which also has a similar bug checking index <= phi->nargs.

Richard.

> Thanks,
> - Tom


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