Skip to content

Commit f5b4021

Browse files
committed
more api changes
1 parent 3e3602e commit f5b4021

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/target/DarwinTarget.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ geode::Result<> DarwinTarget::writeMemory(void* destination, void const* source,
8787
// (this causes a crash in the result destructor, which is not very good)
8888

8989
auto r1 = this->protectMemory(destination, size, this->getWritableProtection());
90-
auto r2 = r1.isOk() ? this->rawWriteMemory(destination, source, size) : r1;
91-
auto r3 = r1.isOk() ? this->protectMemory(destination, size, oldProtection) : r1;
90+
auto r2 = r1.and_(this->rawWriteMemory(destination, source, size));
91+
auto r3 = r2.and_(this->protectMemory(destination, size, oldProtection));
9292

9393
// permissions restored, it's safe to do result stuff now
94-
if (r1.isErr() || r2.isErr() || r3.isErr()) {
94+
if (r3.isErr()) {
9595
// return the first error
96-
return geode::Err(r1.errorOr(r2.errorOr(r3.unwrapErr())));
96+
return geode::Err(r3.unwrapErr());
9797
}
9898
return geode::Ok();
9999
}

test/misc/Mod.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ void makeHookAndWrapper(void* target, T* func, U** orig) {
156156
std::cout << "unable to create handler: " << handleResult.unwrapErr() << "\n";
157157
exit(1);
158158
}
159-
auto handle = *handleResult;
159+
auto handle = handleResult.unwrap();
160160

161161
auto h_metadata = HookMetadata {
162162
.m_priority = 2

0 commit comments

Comments
 (0)