From 52d8906c8d7cd430882555881883e658b37493b8 Mon Sep 17 00:00:00 2001 From: Xusong Wang Date: Tue, 19 Jul 2022 23:55:40 +0000 Subject: Change OWNERS. Test: n/a Change-Id: I55eaea5396d853fb55e71a62b70a9c4c48f2ce3f --- OWNERS | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/OWNERS b/OWNERS index 5e4e8cd..1f31354 100644 --- a/OWNERS +++ b/OWNERS @@ -1,5 +1,2 @@ -butlermichael@google.com -dgross@google.com -jeanluc@google.com -miaowang@google.com +include platform/frameworks/rs:/RS_OWNERS # Bug component: 43047 srhines@google.com -- cgit v1.2.3 From c94084c7cd81c9d17f74e666a3b7d0788c592b62 Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Wed, 21 Dec 2022 15:55:06 -0800 Subject: Suppress nullptr dereference warnings. It's unclear to me if passing nullptr to NormalizeType can eventually cause a null dereference. Add a call to slangAssert(Context) before using Context just to remove the warning on potential null Context. Bug: 263274255 Test: presubmit; make tidy-frameworks-compile_subset Change-Id: I19010454cc0ea45d66d2b436d16e6759d0c3cdcd --- slang_rs_export_type.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/slang_rs_export_type.cpp b/slang_rs_export_type.cpp index afeb6c5..ffe8ffc 100644 --- a/slang_rs_export_type.cpp +++ b/slang_rs_export_type.cpp @@ -333,6 +333,8 @@ static const clang::Type *TypeExportableHelper( // // TODO(zonr/srhines): allow bit fields of size 8, 16, 32 if (FD->isBitField()) { + // Context can be null from NormalizeType? + slangAssert(Context); Context->ReportError( FD->getLocation(), "bit fields are not able to be exported: '%0.%1'") @@ -415,6 +417,8 @@ static const clang::Type *TypeExportableHelper( case clang::Type::Enum: { // FIXME: We currently convert enums to integers, rather than reflecting // a more complete (and nicer type-safe Java version). + // Context can be null from NormalizeType? + slangAssert(Context); return Context->getASTContext().IntTy.getTypePtr(); } default: { @@ -797,6 +801,8 @@ llvm::StringRef RSExportType::GetTypeName(const clang::Type* T) { const clang::PointerType *P = static_cast(CTI); const clang::Type *PT = GetPointeeType(P); llvm::StringRef PointeeName; + // Passing nullptr as Context to NormalizeType can cause TypeExportableHelper + // to dereference a null Context? if (NormalizeType(PT, PointeeName, nullptr, nullptr, NotLegacyKernelArgument)) { char *Name = new char[ 1 /* * */ + PointeeName.size() + 1 ]; -- cgit v1.2.3