diff options
author | Martin Liska <mliska@suse.cz> | 2020-02-04 14:57:59 +0100 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2020-05-05 15:54:57 +0200 |
commit | 98f7381d17a1ad47773b70a5de7d94a164357916 (patch) | |
tree | 2b88eee7953101d9e6b43011bcbc58d615169803 /liboffloadmic | |
parent | d73d45f19180a474b1bd3af3c9cdf52da3bafc78 (diff) | |
download | gcc-98f7381d17a1ad47773b70a5de7d94a164357916.zip gcc-98f7381d17a1ad47773b70a5de7d94a164357916.tar.gz gcc-98f7381d17a1ad47773b70a5de7d94a164357916.tar.bz2 |
Put index check before use.
liboffloadmic/ChangeLog:
2020-02-04 Martin Liska <mliska@suse.cz>
PR other/89860
* runtime/offload_target.cpp: Put index check
before its use.
Diffstat (limited to 'liboffloadmic')
-rw-r--r-- | liboffloadmic/runtime/offload_target.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/liboffloadmic/runtime/offload_target.cpp b/liboffloadmic/runtime/offload_target.cpp index 8273faa..16ba4a3 100644 --- a/liboffloadmic/runtime/offload_target.cpp +++ b/liboffloadmic/runtime/offload_target.cpp @@ -329,7 +329,7 @@ void OffloadDescriptor::merge_var_descs( } } // instead of m_vars[i].type.dst we will use m_vars_extra[i].type_dst - if (m_vars[i].type.dst == c_extended_type && i < vars_total) { + if (i < vars_total && m_vars[i].type.dst == c_extended_type) { VarDescExtendedType *etype = reinterpret_cast<VarDescExtendedType*>(vars[i].into); m_vars_extra[i].type_dst = etype->extended_type; |