git: fdf278410104 - main - Apply clang fix for assertion failure compiling science/chrono
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 30 Jan 2022 20:41:53 UTC
The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=fdf27841010464ad65c8791077a07000cdb01013 commit fdf27841010464ad65c8791077a07000cdb01013 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2022-01-30 20:41:24 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2022-01-30 20:41:37 +0000 Apply clang fix for assertion failure compiling science/chrono Merge commit 6b0f35931a44 from llvm git (by Jennifer Yu): Fix signal during the call to checkOpenMPLoop. The root problem is a null pointer is accessed during the call to checkOpenMPLoop, because loop up bound expr is an error expression due to error diagnostic was emit early. To fix this, in setLCDeclAndLB, setUB and setStep instead return false, return true when LB, UB or Step contains Error, so that the checking is stopped in checkOpenMPLoop. Differential Revision: https://reviews.llvm.org/D107385 Note this only fixes the assertion reported in bug 261567; some other tweaks for port dependencies are probably still required to make it build to completion. PR: 261567 MFC after: 3 days --- contrib/llvm-project/clang/lib/Sema/SemaOpenMP.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/llvm-project/clang/lib/Sema/SemaOpenMP.cpp b/contrib/llvm-project/clang/lib/Sema/SemaOpenMP.cpp index c0cd2bf18a77..fc05f040b0d4 100644 --- a/contrib/llvm-project/clang/lib/Sema/SemaOpenMP.cpp +++ b/contrib/llvm-project/clang/lib/Sema/SemaOpenMP.cpp @@ -7342,7 +7342,7 @@ bool OpenMPIterationSpaceChecker::setLCDeclAndLB(ValueDecl *NewLCDecl, // State consistency checking to ensure correct usage. assert(LCDecl == nullptr && LB == nullptr && LCRef == nullptr && UB == nullptr && Step == nullptr && !TestIsLessOp && !TestIsStrictOp); - if (!NewLCDecl || !NewLB) + if (!NewLCDecl || !NewLB || NewLB->containsErrors()) return true; LCDecl = getCanonicalDecl(NewLCDecl); LCRef = NewLCRefExpr; @@ -7365,7 +7365,7 @@ bool OpenMPIterationSpaceChecker::setUB(Expr *NewUB, // State consistency checking to ensure correct usage. assert(LCDecl != nullptr && LB != nullptr && UB == nullptr && Step == nullptr && !TestIsLessOp && !TestIsStrictOp); - if (!NewUB) + if (!NewUB || NewUB->containsErrors()) return true; UB = NewUB; if (LessOp) @@ -7380,7 +7380,7 @@ bool OpenMPIterationSpaceChecker::setUB(Expr *NewUB, bool OpenMPIterationSpaceChecker::setStep(Expr *NewStep, bool Subtract) { // State consistency checking to ensure correct usage. assert(LCDecl != nullptr && LB != nullptr && Step == nullptr); - if (!NewStep) + if (!NewStep || NewStep->containsErrors()) return true; if (!NewStep->isValueDependent()) { // Check that the step is integer expression.