public BlockStatement Process(DecompilationContext context, BlockStatement body)
		{
			MethodDefinition method = context.MethodContext.Method;

			if (!method.IsUnsafe && method.HasBody && IsUnsafe(method.Body.Instructions))
			{
				UnsafeBlockStatement unsafeStatement = new UnsafeBlockStatement(body.Statements);
				body.Statements = new StatementCollection();
				body.AddStatement(unsafeStatement);
			}

			return body;
		}
Пример #2
0
 public override Statement CloneStatementOnly()
 {
     V_0 = new UnsafeBlockStatement(new StatementCollection());
     V_1 = this.get_Statements().GetEnumerator();
     try
     {
         while (V_1.MoveNext())
         {
             V_2 = V_1.get_Current();
             V_0.AddStatement(V_2.CloneStatementOnly());
         }
     }
     finally
     {
         if (V_1 != null)
         {
             V_1.Dispose();
         }
     }
     this.CopyParentAndLabel(V_0);
     return(V_0);
 }
 public override void VisitUnsafeBlockStatement(UnsafeBlockStatement unsafeBlock)
 {
     WriteKeyword(KeyWordWriter.Unsafe);
     WriteLine();
     VisitBlockStatement(unsafeBlock);
 }
 public virtual void VisitUnsafeBlockStatement(UnsafeBlockStatement unsafeBlock)
 {
     Visit(unsafeBlock.Statements);
 }