aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-07-07 05:11:00 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-07-07 05:11:00 +0000
commit1d0fae980d23592aaff3006fc27731e1269e829f (patch)
tree4850f24fbea0fbd80883d9e31a6a670997ec3ae8
parent2e1caa4899a0fff069bc200ac29c099e81f0fd99 (diff)
parent2c3f4c361d131e500f6de3c417b819a05d13cf1f (diff)
downloadlibbcc-android14-mainline-permission-release.tar.gz
Change-Id: Iad7820cd471d26b21f043a331bdb8ad9735d14bc
-rw-r--r--OWNERS5
-rw-r--r--lib/Android.bp13
-rw-r--r--lib/RSGlobalInfoPass.cpp20
-rw-r--r--lib/RSInvokeHelperPass.cpp4
-rw-r--r--lib/RSUtils.h3
-rw-r--r--lib/RSX86TranslateGEPPass.cpp1
6 files changed, 35 insertions, 11 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
diff --git a/lib/Android.bp b/lib/Android.bp
index 7c53f60..6ddc652 100644
--- a/lib/Android.bp
+++ b/lib/Android.bp
@@ -80,13 +80,12 @@ cc_library {
"libdl",
"liblog",
],
- },
- },
-
- product_variables: {
- unbundled_build: {
- // Don't build in unbundled branches
- enabled: false,
+ product_variables: {
+ unbundled_build: {
+ // Don't build in unbundled branches
+ enabled: false,
+ },
+ },
},
},
}
diff --git a/lib/RSGlobalInfoPass.cpp b/lib/RSGlobalInfoPass.cpp
index 40d658b..d9e64f3 100644
--- a/lib/RSGlobalInfoPass.cpp
+++ b/lib/RSGlobalInfoPass.cpp
@@ -206,6 +206,10 @@ public:
llvm::Value *V = M.getOrInsertGlobal(kRsGlobalEntries, Int32Ty);
llvm::GlobalVariable *GlobalEntries =
llvm::dyn_cast<llvm::GlobalVariable>(V);
+ if (!GlobalEntries) {
+ // Abort when dynamic_cast failed?
+ return false;
+ }
llvm::Constant *GlobalEntriesInit =
llvm::ConstantInt::get(Int32Ty, NumGlobals);
GlobalEntries->setInitializer(GlobalEntriesInit);
@@ -215,6 +219,10 @@ public:
V = M.getOrInsertGlobal(kRsGlobalNames, VoidPtrArrayTy);
llvm::GlobalVariable *GlobalNames =
llvm::dyn_cast<llvm::GlobalVariable>(V);
+ if (!GlobalNames) {
+ // Abort when dynamic_cast failed?
+ return false;
+ }
llvm::Constant *GlobalNamesInit =
llvm::ConstantArray::get(VoidPtrArrayTy, GVNames);
GlobalNames->setInitializer(GlobalNamesInit);
@@ -224,6 +232,10 @@ public:
V = M.getOrInsertGlobal(kRsGlobalAddresses, VoidPtrArrayTy);
llvm::GlobalVariable *GlobalAddresses =
llvm::dyn_cast<llvm::GlobalVariable>(V);
+ if (!GlobalAddresses) {
+ // Abort when dynamic_cast failed?
+ return false;
+ }
llvm::Constant *GlobalAddressesInit =
llvm::ConstantArray::get(VoidPtrArrayTy, GVAddresses);
GlobalAddresses->setInitializer(GlobalAddressesInit);
@@ -234,6 +246,10 @@ public:
V = M.getOrInsertGlobal(kRsGlobalSizes, SizeArrayTy);
llvm::GlobalVariable *GlobalSizes =
llvm::dyn_cast<llvm::GlobalVariable>(V);
+ if (!GlobalSizes) {
+ // Abort when dynamic_cast failed?
+ return false;
+ }
llvm::Constant *GlobalSizesInit;
if (PointerSizeInBits == 32) {
GlobalSizesInit = llvm::ConstantDataArray::get(M.getContext(), GVSizes32);
@@ -247,6 +263,10 @@ public:
V = M.getOrInsertGlobal(kRsGlobalProperties, Int32ArrayTy);
llvm::GlobalVariable *GlobalProperties =
llvm::dyn_cast<llvm::GlobalVariable>(V);
+ if (!GlobalProperties) {
+ // Abort when dynamic_cast failed?
+ return false;
+ }
llvm::Constant *GlobalPropertiesInit =
llvm::ConstantDataArray::get(M.getContext(), GVProperties);
GlobalProperties->setInitializer(GlobalPropertiesInit);
diff --git a/lib/RSInvokeHelperPass.cpp b/lib/RSInvokeHelperPass.cpp
index 99316ce..a22909f 100644
--- a/lib/RSInvokeHelperPass.cpp
+++ b/lib/RSInvokeHelperPass.cpp
@@ -177,6 +177,10 @@ public:
continue;
llvm::StructType *argStructType = llvm::dyn_cast<llvm::StructType>(argType->getPointerElementType());
+ if (!argStructType) {
+ // Abort when dynamic_cast failed?
+ continue;
+ }
for (unsigned int i = 0; i < argStructType->getNumElements(); i++) {
llvm::Type *currentType = argStructType->getElementType(i);
diff --git a/lib/RSUtils.h b/lib/RSUtils.h
index e7ce1b5..f30f4d1 100644
--- a/lib/RSUtils.h
+++ b/lib/RSUtils.h
@@ -28,6 +28,9 @@
namespace {
static inline llvm::StringRef getUnsuffixedStructName(const llvm::StructType *T) {
+ if (!T) {
+ abort(); // exit?
+ }
#ifdef _DEBUG
// Bug: 22926131
// When building with assertions enabled, LLVM cannot read the name of a
diff --git a/lib/RSX86TranslateGEPPass.cpp b/lib/RSX86TranslateGEPPass.cpp
index 52dee0d..113ca28 100644
--- a/lib/RSX86TranslateGEPPass.cpp
+++ b/lib/RSX86TranslateGEPPass.cpp
@@ -77,6 +77,7 @@ private:
if (!OpC) {
ALOGE("Operand for struct type is not constant!");
bccAssert(false);
+ return nullptr; // NOLINT, unreached
}
// Offset = Offset + EltOffset for index into a struct