[Openmp-commits] [PATCH] D51623: [libomptarget] PR38704: Fix erase	of ShadowPtrMap
    Jonas Hahnfeld via Phabricator via Openmp-commits 
    openmp-commits at lists.llvm.org
       
    Tue Sep  4 10:43:04 PDT 2018
    
    
  
Hahnfeld added a comment.
In https://reviews.llvm.org/D51623#1223437, @sdmitriev wrote:
> Not related to this patch, but I think there is one more potentially incorrect use of containers in RTLsTy::RegisterLib(). This function may increase size of the global vector Devices when it initializes a new RTL that has not been yet used (see rtl.cpp line 219). This may result in memory reallocation and thus all pointers to the Devices elements that are stored in RTLs (see rtl.cpp line 228) would become invalid. I am not sure if these pointers are really used by RTLs now, but if yes, than it is a problem. RTLsTy::RegisterLib may be called more than once and each call may potentially initialize new RTLs.
Hehe, turns out: Yes and no!
Yes, this is undoubtly incorrect. But no, this can never happen because nobody is accessing the `RTLInfoTy::Devices` :D
Do you want to submit a patch removing `Devices` from `RTLInfoTy`?
Repository:
  rL LLVM
https://reviews.llvm.org/D51623
    
    
More information about the Openmp-commits
mailing list