Skip to content

Commit

Permalink
Merge branch 'xenia-canary:canary_experimental' into New_XMA
Browse files Browse the repository at this point in the history
  • Loading branch information
backgamon authored Nov 13, 2023
2 parents c4fdfcb + 50b4237 commit 8e951bf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/xenia/kernel/xobject.cc
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,16 @@ uint8_t* XObject::CreateNative(uint32_t size) {
SetNativePointer(mem + sizeof(X_OBJECT_HEADER), true);

auto header = memory()->TranslateVirtual<X_OBJECT_HEADER*>(mem);
// todo: should check whether
header->flags = OBJECT_HEADER_IS_TITLE_OBJECT;
header->pointer_count = 1;
header->handle_count = 0;
header->object_type_ptr = 0;

// Added to prevent having nullptr crashes on semaphore.
// This should probably work differently, but for now it is good enough (hopefully).
auto object_type = memory()->SystemHeapAlloc(sizeof(X_OBJECT_TYPE));
if (object_type) {
header->object_type_ptr = object_type;
}

return memory()->TranslateVirtual(guest_object_ptr_);
}
Expand Down

0 comments on commit 8e951bf

Please sign in to comment.