|
|
|
@ -29,6 +29,8 @@ namespace Decompiler
@@ -29,6 +29,8 @@ namespace Decompiler
|
|
|
|
|
{ |
|
|
|
|
Ast.BlockStatement astBlock = new Ast.BlockStatement(); |
|
|
|
|
|
|
|
|
|
if (methodDef.Body == null) return astBlock; |
|
|
|
|
|
|
|
|
|
methodDef.Body.Simplify(); |
|
|
|
|
|
|
|
|
|
ByteCodeCollection body = new ByteCodeCollection(methodDef); |
|
|
|
@ -521,6 +523,7 @@ namespace Decompiler
@@ -521,6 +523,7 @@ namespace Decompiler
|
|
|
|
|
case Code.Ldc_R8: return new Ast.PrimitiveExpression(operand, null); |
|
|
|
|
case Code.Ldfld: |
|
|
|
|
case Code.Ldsfld: { |
|
|
|
|
if (operand is FieldDefinition) { |
|
|
|
|
FieldDefinition field = (FieldDefinition) operand; |
|
|
|
|
if (field.IsStatic) { |
|
|
|
|
return new Ast.MemberReferenceExpression( |
|
|
|
@ -530,6 +533,10 @@ namespace Decompiler
@@ -530,6 +533,10 @@ namespace Decompiler
|
|
|
|
|
} else { |
|
|
|
|
return new Ast.MemberReferenceExpression(arg1, field.Name); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
// TODO: Static accesses
|
|
|
|
|
return new Ast.MemberReferenceExpression(arg1, ((FieldReference)operand).Name); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
case Code.Stfld: |
|
|
|
|
case Code.Stsfld: { |
|
|
|
@ -634,8 +641,12 @@ namespace Decompiler
@@ -634,8 +641,12 @@ namespace Decompiler
|
|
|
|
|
|
|
|
|
|
static Ast.Expression Convert(Ast.Expression expr, Cecil.TypeReference reqType) |
|
|
|
|
{ |
|
|
|
|
if (reqType == null) { |
|
|
|
|
return expr; |
|
|
|
|
} else { |
|
|
|
|
return Convert(expr, reqType.FullName); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static Ast.Expression Convert(Ast.Expression expr, string reqType) |
|
|
|
|
{ |
|
|
|
|