diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-01-18 05:22:01 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-01-18 05:22:01 +0000 |
commit | a8e2a93b64a4a9ce0587a6278645f387750108ae (patch) | |
tree | a85f0aebda6323f25951bba64272fccba9821150 | |
parent | b28ebc5ac9c11f9f2c752a36d7c19f572c5b53f5 (diff) | |
parent | bbf79d4c8427e32bb684acb02197d2ef9f806223 (diff) | |
download | slang-android14-d1-s5-release.tar.gz |
Snap for 9500284 from bbf79d4c8427e32bb684acb02197d2ef9f806223 to udc-d1-releaseandroid-14.0.0_r9android-14.0.0_r8android-14.0.0_r7android-14.0.0_r6android-14.0.0_r5android-14.0.0_r4android-14.0.0_r3android-14.0.0_r12android-14.0.0_r11android-14.0.0_r10android14-d1-s7-releaseandroid14-d1-s6-releaseandroid14-d1-s5-releaseandroid14-d1-s4-releaseandroid14-d1-s3-releaseandroid14-d1-s2-releaseandroid14-d1-s1-releaseandroid14-d1-release
Change-Id: Ib7cd31110e9fc63365364e83d4ff2b15da2be8c9
-rw-r--r-- | slang_rs_export_type.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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 ]; |