@@ -2288,7 +2288,7 @@ MethodSpecification ReadMethodSpecSignature (uint signature, MethodReference met
2288
2288
if ( call_conv != methodspec_sig )
2289
2289
throw new NotSupportedException ( ) ;
2290
2290
2291
- var arity = reader . ReadCompressedUInt32 ( ) ;
2291
+ var arity = sig . ReadCompressedUInt32 ( ) ;
2292
2292
2293
2293
var instance = new GenericInstanceMethod ( method , ( int ) arity ) ;
2294
2294
@@ -3430,10 +3430,10 @@ TypeReference ReadTypeSignature (ElementType etype, ref PByteBuffer buffer)
3430
3430
var is_value_type = buffer . ReadByte ( ) == ( byte ) ElementType . ValueType ;
3431
3431
var element_type = GetTypeDefOrRef ( ReadTypeTokenSignature ( ref buffer ) ) ;
3432
3432
3433
- var arity = ReadCompressedUInt32 ( ) ;
3433
+ var arity = buffer . ReadCompressedUInt32 ( ) ;
3434
3434
var generic_instance = new GenericInstanceType ( element_type ) ;
3435
3435
3436
- ReadGenericInstanceSignature ( element_type , generic_instance , arity ref buffer) ;
3436
+ ReadGenericInstanceSignature ( element_type , generic_instance , arity , ref buffer ) ;
3437
3437
3438
3438
if ( is_value_type ) {
3439
3439
generic_instance . KnownValueType ( ) ;
@@ -3833,8 +3833,7 @@ public Collection<SequencePoint> ReadSequencePoints (Document document, ref PByt
3833
3833
//there's about 5 compressed int32's per sequence points. we don't know exactly how many
3834
3834
//but let's take a conservative guess so we dont end up reallocating the sequence_points collection
3835
3835
//as it grows.
3836
- var bytes_remaining_for_sequencepoints = sig_length - ( position - start ) ;
3837
- var estimated_sequencepoint_amount = ( int ) bytes_remaining_for_sequencepoints / 5 ;
3836
+ var estimated_sequencepoint_amount = ( int ) buffer . RemainingBytes ( ) / 5 ;
3838
3837
var sequence_points = new Collection < SequencePoint > ( estimated_sequencepoint_amount ) ;
3839
3838
3840
3839
for ( var i = 0 ; buffer . CanReadMore ( ) ; i ++ ) {
@@ -3880,10 +3879,5 @@ public Collection<SequencePoint> ReadSequencePoints (Document document, ref PByt
3880
3879
3881
3880
return sequence_points ;
3882
3881
}
3883
-
3884
- public bool CanReadMore ( )
3885
- {
3886
- return ( position - start ) < sig_length ;
3887
- }
3888
3882
}
3889
3883
}
0 commit comments