diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-07 05:11:02 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-07 05:11:02 +0000 |
commit | 77ab3dd8697cace46b30563e721e69b0f5c66ecf (patch) | |
tree | a85f0aebda6323f25951bba64272fccba9821150 | |
parent | 111270a3f14deabdde8b5d30e53dfd3a091638a8 (diff) | |
parent | 8e9a212552c9096cfeccaacd65dea1d1bca88107 (diff) | |
download | slang-77ab3dd8697cace46b30563e721e69b0f5c66ecf.tar.gz |
Snap for 10453563 from 8e9a212552c9096cfeccaacd65dea1d1bca88107 to mainline-permission-releaseaml_per_341711000aml_per_341614000aml_per_341510010aml_per_341410020aml_per_341311000aml_per_341110020aml_per_341110010aml_per_341011100aml_per_341011020aml_per_340916010android14-mainline-permission-release
Change-Id: I66c262625756a232659496c6269a58fdf73d7c95
-rw-r--r-- | OWNERS | 5 | ||||
-rw-r--r-- | slang_rs_export_type.cpp | 6 |
2 files changed, 7 insertions, 4 deletions
@@ -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 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<const clang::PointerType*>(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 ]; |