Check the mutex tag in MutexLock if the given handle isn't found

Makes sure the correct error is reported as HOS only reports
InvalidHandle if the tag matches.
This commit is contained in:
Billy Laws 2021-05-30 17:47:34 +01:00
parent 476bb65f37
commit 99a839d669

View File

@ -110,6 +110,9 @@ namespace skyline::kernel::type {
try {
owner = GetHandle<KThread>(ownerHandle);
} catch (const std::out_of_range &) {
if (*mutex != (ownerHandle | HandleWaitersBit))
return result::InvalidCurrentMemory;
return result::InvalidHandle;
}