aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/object.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-12-03 22:50:16 -0500
committerLioncash <mathew1800@gmail.com>2018-12-04 02:20:47 -0500
commit59a4ed0d2477999e979373eb821f024bf0d9d4c6 (patch)
tree837d0d14341f50cda47b73d5128104980eb1afbc /src/core/hle/kernel/object.cpp
parent9ca1a2dcbccab5c775890adb1e22ccd40a115979 (diff)
kernel/object: Amend handle types to distinguish between readable and writable events
Two kernel object should absolutely never have the same handle ID type. This can cause incorrect behavior when it comes to retrieving object types from the handle table. In this case it allows converting a WritableEvent into a ReadableEvent and vice-versa, which is undefined behavior, since the object types are not the same. This also corrects ClearEvent() to check both kernel types like the kernel itself does.
Diffstat (limited to 'src/core/hle/kernel/object.cpp')
-rw-r--r--src/core/hle/kernel/object.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/hle/kernel/object.cpp b/src/core/hle/kernel/object.cpp
index d87a62bb93..bb1b687786 100644
--- a/src/core/hle/kernel/object.cpp
+++ b/src/core/hle/kernel/object.cpp
@@ -13,7 +13,7 @@ Object::~Object() = default;
bool Object::IsWaitable() const {
switch (GetHandleType()) {
- case HandleType::Event:
+ case HandleType::ReadableEvent:
case HandleType::Thread:
case HandleType::Timer:
case HandleType::ServerPort:
@@ -21,6 +21,7 @@ bool Object::IsWaitable() const {
return true;
case HandleType::Unknown:
+ case HandleType::WritableEvent:
case HandleType::SharedMemory:
case HandleType::Process:
case HandleType::AddressArbiter: