File tree 3 files changed +8
-8
lines changed
3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ internal CLRObject(object ob, IntPtr tp)
11
11
{
12
12
IntPtr py = Runtime . PyType_GenericAlloc ( tp , 0 ) ;
13
13
14
- IntPtr flags = Marshal . ReadIntPtr ( tp , TypeOffset . tp_flags ) ;
15
- if ( flags != IntPtr . Zero && TypeFlags . Subclass != 0 )
14
+ var flags = ( long ) Marshal . ReadIntPtr ( tp , TypeOffset . tp_flags ) ;
15
+ if ( ( flags & TypeFlags . Subclass ) != 0 )
16
16
{
17
17
IntPtr dict = Marshal . ReadIntPtr ( py , ObjectOffset . DictOffset ( tp ) ) ;
18
18
if ( dict == IntPtr . Zero )
Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ internal static ManagedType GetManagedObject(IntPtr ob)
28
28
tp = ob ;
29
29
}
30
30
31
- IntPtr flags = Marshal . ReadIntPtr ( tp , TypeOffset . tp_flags ) ;
32
- if ( flags != IntPtr . Zero && TypeFlags . Subclass != 0 )
31
+ var flags = ( long ) Marshal . ReadIntPtr ( tp , TypeOffset . tp_flags ) ;
32
+ if ( ( flags & TypeFlags . Managed ) != 0 )
33
33
{
34
34
IntPtr op = tp == ob
35
35
? Marshal . ReadIntPtr ( tp , TypeOffset . magic ( ) )
@@ -63,8 +63,8 @@ internal static bool IsManagedType(IntPtr ob)
63
63
tp = ob ;
64
64
}
65
65
66
- IntPtr flags = Marshal . ReadIntPtr ( tp , TypeOffset . tp_flags ) ;
67
- if ( flags != IntPtr . Zero && TypeFlags . Subclass != 0 )
66
+ var flags = ( long ) Marshal . ReadIntPtr ( tp , TypeOffset . tp_flags ) ;
67
+ if ( ( flags & TypeFlags . Managed ) != 0 )
68
68
{
69
69
return true ;
70
70
}
Original file line number Diff line number Diff line change @@ -247,8 +247,8 @@ public static void tp_dealloc(IntPtr tp)
247
247
{
248
248
// Fix this when we dont cheat on the handle for subclasses!
249
249
250
- IntPtr flags = Marshal . ReadIntPtr ( tp , TypeOffset . tp_flags ) ;
251
- if ( flags != IntPtr . Zero && TypeFlags . Subclass ! = 0 )
250
+ var flags = ( long ) Marshal . ReadIntPtr ( tp , TypeOffset . tp_flags ) ;
251
+ if ( ( flags & TypeFlags . Subclass ) = = 0 )
252
252
{
253
253
IntPtr gc = Marshal . ReadIntPtr ( tp , TypeOffset . magic ( ) ) ;
254
254
( ( GCHandle ) gc ) . Free ( ) ;
You can’t perform that action at this time.
0 commit comments