[libomptarget] PR38704: Fix erase of ShadowPtrMap
authorJonas Hahnfeld <hahnjo@hahnjo.de>
Tue, 4 Sep 2018 15:13:23 +0000 (15:13 +0000)
committerJonas Hahnfeld <hahnjo@hahnjo.de>
Tue, 4 Sep 2018 15:13:23 +0000 (15:13 +0000)
commitf7f86971e699fd8c860daf88ed06faf670b3258c
tree62309c389e6d0aab544ad6ee37dea2b73d9d1bfb
parent82d20201d05e39b03c3844c85429cb8796ad0580
[libomptarget] PR38704: Fix erase of ShadowPtrMap

erase() invalidates the iterator and returns a new one pointing
to the following element. The code now follows the example at
https://en.cppreference.com/w/cpp/container/map/erase.
(The added testcase crashes without this patch.)

Reported by David Binderman (https://llvm.org/PR38704)!

Differential Revision: https://reviews.llvm.org/D51623

llvm-svn: 341371
openmp/libomptarget/src/omptarget.cpp
openmp/libomptarget/test/mapping/pr38704.c [new file with mode: 0644]