Browse Source

stfld

pull/1/head^2
David Srbecký 18 years ago
parent
commit
57192a1fdc
  1. 10
      bin/Debug/output.cs
  2. 32
      src/AstMetodBodyBuilder.cs

10
bin/Debug/output.cs

@ -26,11 +26,11 @@ namespace Reversi @@ -26,11 +26,11 @@ namespace Reversi
private void InitializeComponent()
{
System.Resources.ResourceManager V_0 = (IL__newobj(.ctor(), Type.GetTypeFromHandle((IL__ldtoken(Reversi.AboutDialog)))));
IL__stfld(iconPictureBox, @this, (IL__newobj(.ctor())));
IL__stfld(titleLabel, @this, (IL__newobj(.ctor())));
IL__stfld(versionLabel, @this, (IL__newobj(.ctor())));
IL__stfld(okButton, @this, (IL__newobj(.ctor())));
IL__stfld(copyrightLabel, @this, (IL__newobj(.ctor())));
@this.iconPictureBox = (IL__newobj(.ctor()));
@this.titleLabel = (IL__newobj(.ctor()));
@this.versionLabel = (IL__newobj(.ctor()));
@this.okButton = (IL__newobj(.ctor()));
@this.copyrightLabel = (IL__newobj(.ctor()));
@this.SuspendLayout();
(@this.iconPictureBox).set_Location((IL__newobj(.ctor(), 77, 56)));
(@this.iconPictureBox).set_Name("iconPictureBox");

32
src/AstMetodBodyBuilder.cs

@ -409,7 +409,36 @@ namespace Decompiler @@ -409,7 +409,36 @@ namespace Decompiler
case Code.Ldc_I8:
case Code.Ldc_R4:
case Code.Ldc_R8: return new Ast.PrimitiveExpression(operand, null);
case Code.Ldfld: return new Ast.MemberReferenceExpression(arg1, ((FieldDefinition)operand).Name);
case Code.Ldfld: {
FieldDefinition field = (FieldDefinition) operand;
if (field.IsStatic) {
return new Ast.MemberReferenceExpression(
new Ast.IdentifierExpression(field.DeclaringType.FullName),
field.Name
);
} else {
return new Ast.MemberReferenceExpression(arg1, field.Name);
}
}
case Code.Stfld: {
FieldDefinition field = (FieldDefinition) operand;
if (field.IsStatic) {
return new AssignmentExpression(
new Ast.MemberReferenceExpression(
new Ast.IdentifierExpression(field.DeclaringType.FullName),
field.Name
),
AssignmentOperatorType.Assign,
arg1
);
} else {
return new AssignmentExpression(
new Ast.MemberReferenceExpression(arg1, field.Name),
AssignmentOperatorType.Assign,
arg2
);
}
}
case Code.Ldflda: throw new NotImplementedException();
case Code.Ldftn: throw new NotImplementedException();
case Code.Ldloc: return new Ast.IdentifierExpression(((VariableDefinition)operand).Name);
@ -436,7 +465,6 @@ namespace Decompiler @@ -436,7 +465,6 @@ namespace Decompiler
case Code.Rethrow: throw new NotImplementedException();
case Code.Sizeof: throw new NotImplementedException();
case Code.Starg: throw new NotImplementedException();
case Code.Stfld: throw new NotImplementedException();
case Code.Stloc:
string name = ((VariableDefinition)operand).Name;
if (localVarDefined[name]) {

Loading…
Cancel
Save