From 06b6e0f4067490825551a81d30d4177b5230f28b Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Tue, 11 Sep 2018 17:16:26 +0000 Subject: [PATCH] [OPENMP]Increment iterator when the loop is continued. Summary: Missed operation of the incrementing iterator when required just to continue execution. Reviewers: kkwli0, gtbercea, grokos Subscribers: guansong, openmp-commits Differential Revision: https://reviews.llvm.org/D51937 llvm-svn: 341964 --- openmp/libomptarget/src/omptarget.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openmp/libomptarget/src/omptarget.cpp b/openmp/libomptarget/src/omptarget.cpp index 233de9e..fd22688 100644 --- a/openmp/libomptarget/src/omptarget.cpp +++ b/openmp/libomptarget/src/omptarget.cpp @@ -423,8 +423,10 @@ int target_data_end(DeviceTy &Device, int32_t arg_num, void **args_base, // An STL map is sorted on its keys; use this property // to quickly determine when to break out of the loop. - if ((uintptr_t) ShadowHstPtrAddr < lb) + if ((uintptr_t) ShadowHstPtrAddr < lb) { + ++it; continue; + } if ((uintptr_t) ShadowHstPtrAddr >= ub) break; -- 2.7.4