Author: hans
Date: Fri Jan 27 10:45:42 2017
New Revision: 293302

URL: http://llvm.org/viewvc/llvm-project?rev=293302&view=rev
Log:
Merging r292590:
------------------------------------------------------------------------
r292590 | abataev | 2017-01-20 00:57:28 -0800 (Fri, 20 Jan 2017) | 6 lines

[OPENMP] Fix for PR31643: Clang crashes when compiling code on Windows
with SEH and openmp

In some cituations (during codegen for Windows SEH constructs)
CodeGenFunction instance may have CurFn equal to nullptr. OpenMP related
code does not expect such situation during cleanup.
------------------------------------------------------------------------

Added:
    cfe/branches/release_40/test/OpenMP/openmp_seh.c
      - copied unchanged from r292590, cfe/trunk/test/OpenMP/openmp_seh.c
Modified:
    cfe/branches/release_40/   (props changed)
    cfe/branches/release_40/lib/CodeGen/CodeGenFunction.cpp

Propchange: cfe/branches/release_40/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan 27 10:45:42 2017
@@ -1,4 +1,4 @@
 /cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:291850,291853,291865,291871,291877,291879,291881,291907,291955,291964,292032,292052,292183,292247,292265,292497,292555,292558-292559,292561,292800,292847,292874,292991
+/cfe/trunk:291850,291853,291865,291871,291877,291879,291881,291907,291955,291964,292032,292052,292183,292247,292265,292497,292555,292558-292559,292561,292590,292800,292847,292874,292991
 /cfe/trunk/test:170344
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/release_40/lib/CodeGen/CodeGenFunction.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/branches/release_40/lib/CodeGen/CodeGenFunction.cpp?rev=293302&r1=293301&r2=293302&view=diff
==============================================================================
--- cfe/branches/release_40/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/branches/release_40/lib/CodeGen/CodeGenFunction.cpp Fri Jan 27 10:45:42 
2017
@@ -112,9 +112,8 @@ CodeGenFunction::~CodeGenFunction() {
   if (FirstBlockInfo)
     destroyBlockInfos(FirstBlockInfo);
 
-  if (getLangOpts().OpenMP) {
+  if (getLangOpts().OpenMP && CurFn)
     CGM.getOpenMPRuntime().functionFinished(*this);
-  }
 }
 
 CharUnits CodeGenFunction::getNaturalPointeeTypeAlignment(QualType T,


_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to