[clang] [Clang] Add a NULL check (PR #77131)

via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 5 11:51:00 PST 2024


https://github.com/InfiniteVerma updated https://github.com/llvm/llvm-project/pull/77131

>From bad1fda58f73e5502df1a1c1ed781c96d86a8ead Mon Sep 17 00:00:00 2001
From: InfiniteVerma <vermainfinite at gmail.com>
Date: Sat, 6 Jan 2024 00:42:34 +0530
Subject: [PATCH] [Clang] Add a NULL check

Fixes #69200
---
 clang/lib/Sema/SemaOpenMP.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index f34d2959dc6191..99f8cac39a3dff 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -21067,6 +21067,10 @@ Sema::ActOnOpenMPDependClause(const OMPDependClause::DependDataTy &Data,
               ExprTy = ATy->getElementType();
             else
               ExprTy = BaseType->getPointeeType();
+            // bug 69200
+            if (ExprTy.isNull()) {
+              continue;
+            }
             ExprTy = ExprTy.getNonReferenceType();
             const Expr *Length = OASE->getLength();
             Expr::EvalResult Result;



More information about the cfe-commits mailing list