diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2017-01-20 08:57:28 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2017-01-20 08:57:28 +0000 |
commit | 880d8605e33704d9c46aef60e6139ce4b3200275 (patch) | |
tree | 8ab3840a61b8b987e0520406be196c802096112a /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | e9b18e3d34f3dbea1649c6633b11d99eda798ec2 (diff) | |
download | llvm-880d8605e33704d9c46aef60e6139ce4b3200275.zip llvm-880d8605e33704d9c46aef60e6139ce4b3200275.tar.gz llvm-880d8605e33704d9c46aef60e6139ce4b3200275.tar.bz2 |
[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.
llvm-svn: 292590
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 39c1425..798d5b4 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -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, |