summaryrefslogtreecommitdiff
path: root/view/sharedcache
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-02-11 21:56:13 -0500
committerMason Reed <mason@vector35.com>2025-02-12 18:43:02 -0500
commitc5edc003b1c0667c936c2ba3a278821da28c3b42 (patch)
treeaf7e9737853ef54a95c4b253205d5327a9f6d299 /view/sharedcache
parentacea6d4a7bb2cef1f84c68c3687331534fe1ede1 (diff)
[SharedCache] Fix misc compiler warnings
These are from clang so there are still a bunch of warnings on GCC and MSVC
Diffstat (limited to 'view/sharedcache')
-rw-r--r--view/sharedcache/core/DSCView.h2
-rw-r--r--view/sharedcache/core/ObjC.cpp1
-rw-r--r--view/sharedcache/core/SharedCache.cpp3
-rw-r--r--view/sharedcache/core/SharedCache.h3
4 files changed, 3 insertions, 6 deletions
diff --git a/view/sharedcache/core/DSCView.h b/view/sharedcache/core/DSCView.h
index bde2f7c2..d47dc179 100644
--- a/view/sharedcache/core/DSCView.h
+++ b/view/sharedcache/core/DSCView.h
@@ -9,7 +9,7 @@
class DSCView : public BinaryNinja::BinaryView {
- bool m_parseOnly;
+ [[maybe_unused]] bool m_parseOnly;
public:
DSCView(const std::string &typeName, BinaryView *data, bool parseOnly = false);
diff --git a/view/sharedcache/core/ObjC.cpp b/view/sharedcache/core/ObjC.cpp
index 8d04d8d4..fa0e603c 100644
--- a/view/sharedcache/core/ObjC.cpp
+++ b/view/sharedcache/core/ObjC.cpp
@@ -549,7 +549,6 @@ void DSCObjCProcessor::LoadCategories(VMReader* reader, Ref<Section> classPtrSec
if (size == 0)
return;
auto ptrSize = m_data->GetAddressSize();
- auto ptrCount = size / m_data->GetAddressSize();
auto classPtrSectionStart = classPtrSection->GetStart();
auto classPtrSectionEnd = classPtrSection->GetEnd();
diff --git a/view/sharedcache/core/SharedCache.cpp b/view/sharedcache/core/SharedCache.cpp
index 2eae9d44..1f3219df 100644
--- a/view/sharedcache/core/SharedCache.cpp
+++ b/view/sharedcache/core/SharedCache.cpp
@@ -1539,7 +1539,6 @@ bool SharedCache::LoadSectionAtAddress(uint64_t address)
}
SharedCacheMachOHeader targetHeader;
- CacheImage* targetImage = nullptr;
MemoryRegion* targetSegment = nullptr;
for (auto& image : MutableState().images)
@@ -1549,7 +1548,6 @@ bool SharedCache::LoadSectionAtAddress(uint64_t address)
if (region.start <= address && region.start + region.size > address)
{
targetHeader = MutableState().headers[image.headerLocation];
- targetImage = &image;
targetSegment = &region;
break;
}
@@ -2532,7 +2530,6 @@ void SharedCache::InitializeHeader(
vm->MappingAtAddress(header.linkeditSegment.vmaddr)
.first.fileAccessor->lock()
->ReadBuffer(header.functionStarts.funcoff, header.functionStarts.funcsize);
- size_t i = 0;
uint64_t curfunc = header.textBase;
uint64_t curOffset;
diff --git a/view/sharedcache/core/SharedCache.h b/view/sharedcache/core/SharedCache.h
index 19445dd9..54c63bb3 100644
--- a/view/sharedcache/core/SharedCache.h
+++ b/view/sharedcache/core/SharedCache.h
@@ -578,12 +578,13 @@ namespace SharedCacheCore {
bool m_metadataValid = false;
/* VIEWSTATE END -- NOTHING PAST THIS IS SERIALIZED */
- std::shared_ptr<ViewSpecificState> m_viewSpecificState;
/* API VIEW START */
BinaryNinja::Ref<BinaryNinja::BinaryView> m_dscView;
/* API VIEW END */
+ std::shared_ptr<ViewSpecificState> m_viewSpecificState;
+
private:
void PerformInitialLoad();
void DeserializeFromRawView();