diff options
author | Jb Evain <jb@evain.net> | 2017-04-04 01:17:08 +0300 |
---|---|---|
committer | Jb Evain <jb@evain.net> | 2017-04-04 01:17:08 +0300 |
commit | 247371c321e770a9789e5698b3ef1e5cf628ba34 (patch) | |
tree | b72bac649bfe0046aa9e44cd7a7339e0a88c6603 | |
parent | 1f7f8f3ea2bbd3cb6c44933413deb7e992b1f20a (diff) |
Clear out symbols that we can't process
-rw-r--r-- | Mono.Cecil/ModuleDefinition.cs | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/Mono.Cecil/ModuleDefinition.cs b/Mono.Cecil/ModuleDefinition.cs index d692a9f..9fdf189 100644 --- a/Mono.Cecil/ModuleDefinition.cs +++ b/Mono.Cecil/ModuleDefinition.cs @@ -966,19 +966,7 @@ namespace Mono.Cecil { public ImageDebugHeader GetDebugHeader () { - if (!HasDebugHeader) - throw new InvalidOperationException (); - - return Image.DebugHeader; - } - - void ProcessDebugHeader () - { - if (!HasDebugHeader) - return; - - if (!symbol_reader.ProcessDebugHeader (GetDebugHeader ())) - throw new InvalidOperationException (); + return Image.DebugHeader ?? new ImageDebugHeader (); } #if !READ_ONLY @@ -1055,7 +1043,10 @@ namespace Mono.Cecil { symbol_reader = reader; - ProcessDebugHeader (); + if (!symbol_reader.ProcessDebugHeader (GetDebugHeader ())) { + symbol_reader = null; + throw new InvalidOperationException (); + } if (HasImage && ReadingMode == ReadingMode.Immediate) { var immediate_reader = new ImmediateModuleReader (Image); |