Imported Upstream version 4.8.0.459

Former-commit-id: 2a5b9df2014f72665850c7f885e7aed54704a53a
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-01-19 14:22:10 +00:00
parent a355c1b831
commit e5cd25ff4f
725 changed files with 1215 additions and 107650 deletions

View File

@@ -159,17 +159,20 @@ namespace Mono.Cecil.Cil {
void ReadScope (ScopeDebugInformation scope)
{
scope.Start = new InstructionOffset (GetInstruction (scope.Start.Offset));
var start_instruction = GetInstruction (scope.Start.Offset);
if (start_instruction != null)
scope.Start = new InstructionOffset (start_instruction);
var end_instruction = GetInstruction (scope.End.Offset);
scope.End = end_instruction == null
? new InstructionOffset ()
: new InstructionOffset (end_instruction);
if (end_instruction != null)
scope.End = new InstructionOffset (end_instruction);
if (!scope.variables.IsNullOrEmpty ()) {
for (int i = 0; i < scope.variables.Count; i++) {
var variable = scope.variables [i];
variable.index = new VariableIndex (GetVariable (variable.Index));
var variable_info = scope.variables [i];
var variable = GetVariable (variable_info.Index);
if (variable != null)
variable_info.index = new VariableIndex (variable);
}
}

View File

@@ -204,7 +204,7 @@ namespace Mono.Cecil.Cil {
directory = new ImageDebugDirectory () {
MajorVersion = 256,
MinorVersion = 20577,
MinorVersion = 20557,
Type = 2,
};
@@ -255,6 +255,7 @@ namespace Mono.Cecil.Cil {
writer.WriteMetadataHeader ();
writer.WriteMetadata ();
writer.Flush ();
writer.stream.Dispose ();
}