File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
source/MetadataProcessor.Core Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -715,7 +715,10 @@ i.Operand is TypeSpecification ||
715
715
{
716
716
if ( e . HandlerType != Mono . Cecil . Cil . ExceptionHandlerType . Filter )
717
717
{
718
- set . Add ( ( ( IMetadataTokenProvider ) e . CatchType ) . MetadataToken ) ;
718
+ if ( e . CatchType != null )
719
+ {
720
+ set . Add ( ( ( IMetadataTokenProvider ) e . CatchType ) . MetadataToken ) ;
721
+ }
719
722
}
720
723
}
721
724
}
Original file line number Diff line number Diff line change @@ -268,8 +268,16 @@ private void DumpTypeDefinitions(DumpAllTable dumpTable)
268
268
269
269
h . Handler = $ "{ ( ( int ) eh . HandlerType ) . ToString ( "x2" ) } " +
270
270
$ "{ eh . TryStart . Offset . ToString ( "x8" ) } ->{ eh . TryEnd . Offset . ToString ( "x8" ) } " +
271
- $ "{ eh . HandlerStart . Offset . ToString ( "x8" ) } ->{ eh . HandlerEnd . Offset . ToString ( "x8" ) } " +
272
- $ "{ eh . CatchType . MetadataToken . ToInt32 ( ) . ToString ( "x8" ) } ";
271
+ $ "{ eh . HandlerStart . Offset . ToString ( "x8" ) } ->{ eh . HandlerEnd . Offset . ToString ( "x8" ) } ";
272
+
273
+ if ( eh . CatchType != null )
274
+ {
275
+ h . Handler += $ "{ eh . CatchType . MetadataToken . ToInt32 ( ) . ToString ( "x8" ) } ";
276
+ }
277
+ else
278
+ {
279
+ h . Handler += "00000000" ;
280
+ }
273
281
274
282
methodDef . ExceptionHandlers . Add ( h ) ;
275
283
}
You can’t perform that action at this time.
0 commit comments