r301536 - Fix asan failures on OpenMP.

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 27 05:22:33 PDT 2017


Author: hokein
Date: Thu Apr 27 07:22:33 2017
New Revision: 301536

URL: http://llvm.org/viewvc/llvm-project?rev=301536&view=rev
Log:
Fix asan failures on OpenMP.

Modified:
    cfe/trunk/lib/Sema/SemaOpenMP.cpp

Modified: cfe/trunk/lib/Sema/SemaOpenMP.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOpenMP.cpp?rev=301536&r1=301535&r2=301536&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOpenMP.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOpenMP.cpp Thu Apr 27 07:22:33 2017
@@ -833,6 +833,8 @@ DSAStackTy::hasDSA(ValueDecl *D,
   auto I = std::prev(StartI);
   do {
     ++I;
+    if (I == EndI)
+      break;
     if (!DPred(I->Directive) && !isParallelOrTaskRegion(I->Directive))
       continue;
     DSAVarData DVar = getDSA(I, D);




More information about the cfe-commits mailing list