File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Expand file tree Collapse file tree 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)
1111 {
1212 IntPtr py = Runtime . PyType_GenericAlloc ( tp , 0 ) ;
1313
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 )
1616 {
1717 IntPtr dict = Marshal . ReadIntPtr ( py , ObjectOffset . DictOffset ( tp ) ) ;
1818 if ( dict == IntPtr . Zero )
Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ internal static ManagedType GetManagedObject(IntPtr ob)
2828 tp = ob ;
2929 }
3030
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 )
3333 {
3434 IntPtr op = tp == ob
3535 ? Marshal . ReadIntPtr ( tp , TypeOffset . magic ( ) )
@@ -63,8 +63,8 @@ internal static bool IsManagedType(IntPtr ob)
6363 tp = ob ;
6464 }
6565
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 )
6868 {
6969 return true ;
7070 }
Original file line number Diff line number Diff line change @@ -247,8 +247,8 @@ public static void tp_dealloc(IntPtr tp)
247247 {
248248 // Fix this when we dont cheat on the handle for subclasses!
249249
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 )
252252 {
253253 IntPtr gc = Marshal . ReadIntPtr ( tp , TypeOffset . magic ( ) ) ;
254254 ( ( GCHandle ) gc ) . Free ( ) ;
You can’t perform that action at this time.
0 commit comments