From 8faee275ed781a4d2929fb8a0e513e4195c93661 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Srbeck=C3=BD?= Date: Sun, 4 Nov 2007 14:35:23 +0000 Subject: [PATCH] Implemented 'call' instruction --- src/AstMetodBodyBuilder.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/AstMetodBodyBuilder.cs b/src/AstMetodBodyBuilder.cs index 381f76af9..f22b5dfa2 100644 --- a/src/AstMetodBodyBuilder.cs +++ b/src/AstMetodBodyBuilder.cs @@ -221,7 +221,14 @@ namespace Decompiler case Code.Arglist: throw new NotImplementedException(); case Code.Box: throw new NotImplementedException(); case Code.Break: throw new NotImplementedException(); - case Code.Call: throw new NotImplementedException(); + case Code.Call: + Cecil.MethodReference cecilMethod = ((MethodReference)operand); + Ast.IdentifierExpression astType = new Ast.IdentifierExpression(cecilMethod.DeclaringType.FullName); + List astArgs = new List(); + for(int i = 0; i < cecilMethod.Parameters.Count; i++) { + astArgs.Add(new Ast.IdentifierExpression("arg" + i)); + } + return new Ast.InvocationExpression(new Ast.MemberReferenceExpression(astType, cecilMethod.Name), astArgs); case Code.Calli: throw new NotImplementedException(); case Code.Callvirt: throw new NotImplementedException(); case Code.Castclass: throw new NotImplementedException();