This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] Fix assert in gimple_phi_arg
- From: Tom de Vries <Tom_deVries at mentor dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 19 Jul 2017 17:42:19 +0200
- Subject: [committed] Fix assert in gimple_phi_arg
- Authentication-results: sourceware.org; auth=none
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.
Thanks,
- Tom
Fix assert in gimple_phi_arg
2017-07-19 Tom de Vries <tom@codesourcery.com>
* gimple.h (gimple_phi_arg): Make assert more strict.
---
gcc/gimple.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 575babe..e19cc1c 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -4341,7 +4341,7 @@ static inline struct phi_arg_d *
gimple_phi_arg (gimple *gs, unsigned index)
{
gphi *phi_stmt = as_a <gphi *> (gs);
- gcc_gimple_checking_assert (index <= phi_stmt->capacity);
+ gcc_gimple_checking_assert (index < phi_stmt->capacity);
return &(phi_stmt->args[index]);
}