mirror of
https://github.com/par274/sharpemu.git
synced 2026-07-16 07:56:12 +08:00
fix: dereference of a possibly null reference.
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using SharpEmu.HLE;
|
using SharpEmu.HLE;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
namespace SharpEmu.Libs.Kernel;
|
namespace SharpEmu.Libs.Kernel;
|
||||||
|
|
||||||
@@ -606,7 +607,7 @@ public static class KernelPthreadCompatExports
|
|||||||
return mutexAddress;
|
return mutexAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool TryResolveMutexState(CpuContext ctx, ulong mutexAddress, bool createIfZero, out ulong resolvedAddress, out PthreadMutexState? state)
|
private static bool TryResolveMutexState(CpuContext ctx, ulong mutexAddress, bool createIfZero, out ulong resolvedAddress, [NotNullWhen(true)] out PthreadMutexState? state)
|
||||||
{
|
{
|
||||||
resolvedAddress = 0;
|
resolvedAddress = 0;
|
||||||
state = null;
|
state = null;
|
||||||
@@ -739,7 +740,7 @@ public static class KernelPthreadCompatExports
|
|||||||
return condAddress;
|
return condAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool TryResolveCondState(CpuContext? ctx, ulong condAddress, bool createIfZero, out ulong resolvedAddress, out PthreadCondState? state)
|
private static bool TryResolveCondState(CpuContext? ctx, ulong condAddress, bool createIfZero, out ulong resolvedAddress, [NotNullWhen(true)] out PthreadCondState? state)
|
||||||
{
|
{
|
||||||
resolvedAddress = 0;
|
resolvedAddress = 0;
|
||||||
state = null;
|
state = null;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using SharpEmu.HLE;
|
|||||||
using System.Buffers.Binary;
|
using System.Buffers.Binary;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
namespace SharpEmu.Libs.Kernel;
|
namespace SharpEmu.Libs.Kernel;
|
||||||
|
|
||||||
@@ -928,7 +929,7 @@ public static class KernelPthreadExtendedCompatExports
|
|||||||
return rwlockAddress;
|
return rwlockAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool TryResolveRwlockState(CpuContext ctx, ulong rwlockAddress, bool createIfZero, out ulong resolvedAddress, out ReaderWriterLockSlim? rwlock)
|
private static bool TryResolveRwlockState(CpuContext ctx, ulong rwlockAddress, bool createIfZero, out ulong resolvedAddress, [NotNullWhen(true)] out ReaderWriterLockSlim? rwlock)
|
||||||
{
|
{
|
||||||
resolvedAddress = 0;
|
resolvedAddress = 0;
|
||||||
rwlock = null;
|
rwlock = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user