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 ||
715715 {
716716 if ( e . HandlerType != Mono . Cecil . Cil . ExceptionHandlerType . Filter )
717717 {
718- set . Add ( ( ( IMetadataTokenProvider ) e . CatchType ) . MetadataToken ) ;
718+ if ( e . CatchType != null )
719+ {
720+ set . Add ( ( ( IMetadataTokenProvider ) e . CatchType ) . MetadataToken ) ;
721+ }
719722 }
720723 }
721724 }
Original file line number Diff line number Diff line change @@ -268,8 +268,16 @@ private void DumpTypeDefinitions(DumpAllTable dumpTable)
268268
269269 h . Handler = $ "{ ( ( int ) eh . HandlerType ) . ToString ( "x2" ) } " +
270270 $ "{ 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+ }
273281
274282 methodDef . ExceptionHandlers . Add ( h ) ;
275283 }
You can’t perform that action at this time.
0 commit comments