Fix Unix debug assert to not use instance handle (#12687)
authorJeremy Kuhne <jeremy.kuhne@microsoft.com>
Sat, 8 Jul 2017 01:24:13 +0000 (18:24 -0700)
committerGitHub <noreply@github.com>
Sat, 8 Jul 2017 01:24:13 +0000 (18:24 -0700)
src/mscorlib/shared/System/IO/FileStream.Unix.cs

index 68afd37..ad68a00 100644 (file)
@@ -875,7 +875,7 @@ namespace System.IO
         /// <returns>The new position in the stream.</returns>
         private long SeekCore(SafeFileHandle fileHandle, long offset, SeekOrigin origin)
         {
-            Debug.Assert(!fileHandle.IsClosed && (GetType() != typeof(FileStream) || CanSeek)); // verify that we can seek, but only if CanSeek won't be a virtual call (which could happen in the ctor)
+            Debug.Assert(!fileHandle.IsClosed && (GetType() != typeof(FileStream) || CanSeekCore(fileHandle))); // verify that we can seek, but only if CanSeek won't be a virtual call (which could happen in the ctor)
             Debug.Assert(origin >= SeekOrigin.Begin && origin <= SeekOrigin.End);
 
             long pos = CheckFileCall(Interop.Sys.LSeek(fileHandle, offset, (Interop.Sys.SeekWhence)(int)origin)); // SeekOrigin values are the same as Interop.libc.SeekWhence values