Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: icsharpcode/ILSpy
base: 1b50ad9
...
head fork: icsharpcode/ILSpy
compare: daa5900
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
View
12 ICSharpCode.Decompiler/Ast/AstBuilder.cs
@@ -1348,6 +1348,7 @@ static Ast.Attribute CreateNonCustomAttribute(Type attributeType, ModuleDefiniti
static void ConvertCustomAttributes(AstNode attributedNode, ICustomAttributeProvider customAttributeProvider, string attributeTarget = null)
{
+ EntityDeclaration entityDecl = attributedNode as EntityDeclaration;
if (customAttributeProvider.HasCustomAttributes) {
var attributes = new List<ICSharpCode.NRefactory.CSharp.Attribute>();
foreach (var customAttribute in customAttributeProvider.CustomAttributes.OrderBy(a => a.AttributeType.FullName)) {
@@ -1359,11 +1360,14 @@ static void ConvertCustomAttributes(AstNode attributedNode, ICustomAttributeProv
// don't show the ParamArrayAttribute (it's converted to the 'params' modifier)
continue;
}
- if (customAttribute.AttributeType.Name == "DebuggerStepThroughAttribute" && customAttribute.AttributeType.Namespace == "System.Diagnostics") {
- // don't show the attribute if the method is async
- EntityDeclaration entityDecl = attributedNode as EntityDeclaration;
- if (entityDecl != null && entityDecl.HasModifier(Modifiers.Async))
+ // if the method is async, remove [DebuggerStepThrough] and [Async
+ if (entityDecl != null && entityDecl.HasModifier(Modifiers.Async)) {
+ if (customAttribute.AttributeType.Name == "DebuggerStepThroughAttribute" && customAttribute.AttributeType.Namespace == "System.Diagnostics") {
continue;
+ }
+ if (customAttribute.AttributeType.Name == "AsyncStateMachineAttribute" && customAttribute.AttributeType.Namespace == "System.Runtime.CompilerServices") {
+ continue;
+ }
}
var attribute = new ICSharpCode.NRefactory.CSharp.Attribute();
View
5 ICSharpCode.Decompiler/ILAst/AsyncDecompiler.cs
@@ -576,6 +576,11 @@ static bool Step2(List<ILNode> body, ref int pos)
if (!(getAwaiterCall.Match(ILCode.Call, out getAwaiterMethod, out awaitedExpr) || getAwaiterCall.Match(ILCode.Callvirt, out getAwaiterMethod, out awaitedExpr)))
return false;
+ if (awaitedExpr.Code == ILCode.AddressOf) {
+ // remove 'AddressOf()' when calling GetAwaiter() on a value type
+ awaitedExpr = awaitedExpr.Arguments[0];
+ }
+
// brtrue(IL_7C, call(valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool>::get_IsCompleted, ldloca(CS$0$0001)))
ILLabel label;
ILExpression getIsCompletedCall;
View
10 ICSharpCode.Decompiler/Tests/Async.cs
@@ -76,6 +76,16 @@ public class Async
}
}
+ public async void StreamCopyToWithConfigureAwait(Stream destination, int bufferSize)
+ {
+ byte[] array = new byte[bufferSize];
+ int count;
+ while ((count = await destination.ReadAsync(array, 0, array.Length).ConfigureAwait(false)) != 0)
+ {
+ await destination.WriteAsync(array, 0, count).ConfigureAwait(false);
+ }
+ }
+
public async void AwaitInLoopCondition()
{
while (await this.SimpleBoolTaskMethod())
View
2  ICSharpCode.Decompiler/Tests/PropertiesAndEvents.cs
@@ -24,7 +24,7 @@ public class PropertiesAndEvents
public event EventHandler AutomaticEvent;
[field: NonSerialized]
- public event EventHandler AutomaticEventWithInitializer = delegate
+ public event EventHandler AutomaticEventWithInitializer = delegate(object sender, EventArgs e)
{
};
View
10 ILSpy.sln
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
-# SharpDevelop 4.2.0.8657-Beta 2
+# SharpDevelop 4.3.0.8807-alpha
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{F45DB999-7E72-4000-B5AD-3A7B485A0896}"
ProjectSection(SolutionItems) = postProject
doc\Command Line.txt = doc\Command Line.txt
@@ -171,6 +171,14 @@ Global
{53DCA265-3C3C-42F9-B647-F72BA678122B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{53DCA265-3C3C-42F9-B647-F72BA678122B}.Release|x86.Build.0 = Release|Any CPU
{53DCA265-3C3C-42F9-B647-F72BA678122B}.Release|x86.ActiveCfg = Release|Any CPU
+ {1D18D788-F7EE-4585-A23B-34DC8EC63CB8}.Debug|x86.Build.0 = Debug|Any CPU
+ {1D18D788-F7EE-4585-A23B-34DC8EC63CB8}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {1D18D788-F7EE-4585-A23B-34DC8EC63CB8}.Release|x86.Build.0 = Release|Any CPU
+ {1D18D788-F7EE-4585-A23B-34DC8EC63CB8}.Release|x86.ActiveCfg = Release|Any CPU
+ {6D3D0F0D-348D-456A-A6ED-E9BD5EFABB6A}.Debug|x86.Build.0 = Debug|Any CPU
+ {6D3D0F0D-348D-456A-A6ED-E9BD5EFABB6A}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {6D3D0F0D-348D-456A-A6ED-E9BD5EFABB6A}.Release|x86.Build.0 = Release|Any CPU
+ {6D3D0F0D-348D-456A-A6ED-E9BD5EFABB6A}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

No commit comments for this range

Something went wrong with that request. Please try again.