Imported Upstream version 5.2.0.175

Former-commit-id: bb0468d0f257ff100aa895eb5fe583fb5dfbf900
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-06-07 13:16:24 +00:00
parent 4bdbaf4a88
commit 966bba02bb
8776 changed files with 346420 additions and 149650 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);
}
}
@@ -315,9 +318,7 @@ namespace Mono.Cecil.Cil {
switch (instruction.opcode.OperandType) {
case OperandType.ShortInlineBrTarget:
case OperandType.InlineBrTarget:
var targetInstruction = GetInstruction ((int) instruction.operand);
if (targetInstruction != null)
instruction.operand = targetInstruction;
instruction.operand = GetInstruction ((int) instruction.operand);
break;
case OperandType.InlineSwitch:
var offsets = (int []) instruction.operand;
@@ -435,13 +436,6 @@ namespace Mono.Cecil.Cil {
}
}
void Align (int align)
{
align--;
var position = Position;
Advance (((position + align) & ~align) - position);
}
public MetadataToken ReadToken ()
{
return new MetadataToken (ReadUInt32 ());