Skip to content
This repository was archived by the owner on Nov 11, 2020. It is now read-only.

Fix async/await decompilation for Roslyn 3.6#5

Open
JarLob wants to merge 1 commit into
dnSpy:ilspyv2from
JarLob:async
Open

Fix async/await decompilation for Roslyn 3.6#5
JarLob wants to merge 1 commit into
dnSpy:ilspyv2from
JarLob:async

Conversation

@JarLob

@JarLob JarLob commented Jul 20, 2020

Copy link
Copy Markdown

Closes https://github.com/0xd4d/dnSpy/issues/1488

Minimal changes to fix the issue, although it seems async/await decompilation logic in ILSpy 6.x is more complex.

@JarLob

JarLob commented Jul 28, 2020

Copy link
Copy Markdown
Author

I just secretly hope @0xd4d doesn't accept the pull request because he/she has almost finished migration to the newest ILSpy version :)

@0xd4d

0xd4d commented Jul 28, 2020

Copy link
Copy Markdown

Thanks for the PR and for pinging me. I'll have a look!

@0xd4d

0xd4d commented Jul 28, 2020

Copy link
Copy Markdown

I tried the code, and it works when it's compiled in Debug mode, but when I compile the example in https://github.com/0xd4d/dnSpy/issues/1488 in Release mode, it fails to decompile it because there are only 4 ILAst instructions.

Changing the 5 check in MatchTaskCreationPattern() to 4 instead seems to solve it.

@JarLob

JarLob commented Jul 28, 2020

Copy link
Copy Markdown
Author

Thanks, will look into it.

@0xd4d

0xd4d commented Jul 28, 2020

Copy link
Copy Markdown

I just noticed that there's a body[pos - 3] that could fail since pos = len-2. We'd need to verify that pos-3 >= 0 first. (line 104)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants