diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2017-11-02 18:55:05 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2017-11-02 18:55:05 +0000 |
commit | 0479348d173c39db1dfaf937c4c6b685679124e3 (patch) | |
tree | acd227b33930e8c981356c08934d8d6aa3d3116c /lib/CodeGen | |
parent | 55dbed804bb40df7c40c98fd0e3e2057d89d0d02 (diff) | |
download | clang-0479348d173c39db1dfaf937c4c6b685679124e3.tar.gz |
[OPENMP] Fix PR35152: Do not use getInvokeDest() function for EH checks.
The compiler may crash under some conditions if the getInvokeDest() is
used, but later it is not used. Fixed this problem in OpenMP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317227 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGOpenMPRuntime.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/CGOpenMPRuntime.cpp b/lib/CodeGen/CGOpenMPRuntime.cpp index 779617adc2..ce7fe9364b 100644 --- a/lib/CodeGen/CGOpenMPRuntime.cpp +++ b/lib/CodeGen/CGOpenMPRuntime.cpp @@ -1451,7 +1451,8 @@ llvm::Value *CGOpenMPRuntime::getThreadID(CodeGenFunction &CGF, return ThreadID; } // If exceptions are enabled, do not use parameter to avoid possible crash. - if (!CGF.getInvokeDest() || + if (!CGF.EHStack.requiresLandingPad() || !CGF.getLangOpts().Exceptions || + !CGF.getLangOpts().CXXExceptions || CGF.Builder.GetInsertBlock() == CGF.AllocaInsertPt->getParent()) { if (auto *OMPRegionInfo = dyn_cast_or_null<CGOpenMPRegionInfo>(CGF.CapturedStmtInfo)) { |