Imported Upstream version 5.4.0.199

Former-commit-id: f4d318e4b2f128fa9f4d31b37bb3839a3fc0dfb2
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-09-25 16:57:44 +00:00
parent 536cd135cc
commit 5924117973
223 changed files with 3826 additions and 487 deletions

View File

@@ -160,7 +160,8 @@ namespace Mono.Cecil.Cil {
void ReadScope (ScopeDebugInformation scope)
{
var start_instruction = GetInstruction (scope.Start.Offset);
scope.Start = new InstructionOffset (start_instruction);
if (start_instruction != null)
scope.Start = new InstructionOffset (start_instruction);
var end_instruction = GetInstruction (scope.End.Offset);
scope.End = end_instruction != null

View File

@@ -2954,14 +2954,20 @@ namespace Mono.Cecil {
if (record.Col2.Length > 0) {
scope.variables = new Collection<VariableDebugInformation> ((int) record.Col2.Length);
for (uint i = 0; i < record.Col2.Length; i++)
scope.variables.Add (ReadLocalVariable (record.Col2.Start + i));
for (uint i = 0; i < record.Col2.Length; i++) {
var variable = ReadLocalVariable (record.Col2.Start + i);
if (variable != null)
scope.variables.Add (variable);
}
}
if (record.Col3.Length > 0) {
scope.constants = new Collection<ConstantDebugInformation> ((int) record.Col3.Length);
for (uint i = 0; i < record.Col3.Length; i++)
scope.constants.Add (ReadLocalConstant (record.Col3.Start + i));
for (uint i = 0; i < record.Col3.Length; i++) {
var constant = ReadLocalConstant (record.Col3.Start + i);
if (constant != null)
scope.constants.Add (constant);
}
}
return scope;