This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [committed] Fix assert in gimple_phi_arg
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Tom de Vries <Tom_deVries at mentor dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 20 Jul 2017 10:46:08 +0200
- Subject: Re: [committed] Fix assert in gimple_phi_arg
- Authentication-results: sourceware.org; auth=none
- References: <bedf7450-07c0-84f5-6ce0-d5ddd5320bef@mentor.com>
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