diff options
author | Jan Hubicka <jh@suse.cz> | 2020-10-10 22:16:59 +0200 |
---|---|---|
committer | Jan Hubicka <jh@suse.cz> | 2020-10-10 22:16:59 +0200 |
commit | 988f0466e80a6e4cc758f4df387b6c021b1cb078 (patch) | |
tree | f80ca91ec97a29f53d2ebc92fa0fb18a9b0f28bd /gcc | |
parent | 5d2cedaaa39bf1920e698e93d8fc460021aabc6d (diff) | |
download | gcc-988f0466e80a6e4cc758f4df387b6c021b1cb078.zip gcc-988f0466e80a6e4cc758f4df387b6c021b1cb078.tar.gz gcc-988f0466e80a6e4cc758f4df387b6c021b1cb078.tar.bz2 |
Fix ICE in remap_arguments with removed parameters.
* ipa-modref.c (remap_arguments): Check range in map access.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ipa-modref.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ipa-modref.c b/gcc/ipa-modref.c index 4330b9e..0fbb943 100644 --- a/gcc/ipa-modref.c +++ b/gcc/ipa-modref.c @@ -1333,7 +1333,12 @@ remap_arguments (vec <int> *map, modref_records *tt) modref_access_node *access_node; FOR_EACH_VEC_SAFE_ELT (ref_node->accesses, k, access_node) if (access_node->parm_index > 0) - access_node->parm_index = (*map)[access_node->parm_index]; + { + if (access_node->parm_index < (int)map->length ()) + access_node->parm_index = (*map)[access_node->parm_index]; + else + access_node->parm_index = -1; + } } } } |