-
Notifications
You must be signed in to change notification settings - Fork 151
CCRewriter produces invalid IL on async method or iterator blocks #38
Comments
It seems like PR #52 fixes these issues |
I'll test it, but I don't think that this PR will fix this issue, just because this issue not only with async methods but with iterator blocks, and this issue is happening in VS 2013 with isRoslyn == false. |
Tested the fix. Issue is still there. |
Can you clarify: You posted two examples, one for async, one for iterators. Does the pull request fix the async example for you ? |
As I mentioned, this issue is not related to Roslyn at all and happening in VS2013. So basically this fix is not applicable, because state I've tested this fix for both async and iterator block and this code still breaks. As I mentioned, this bug is more subtle and to reproduce it you need more complex precondition (using ||, && conditions). |
Hm, my mistake. Read the issue a bit to fast and mistook the inequality for equality. With Perform Runtime Contract Checking == Full it works (but requires the PR for VS2015). |
…ync/iterators. Fix for microsoft#38
Fixed. |
Code Contracts version: 1.7.11202.10 (reproduces on earlier versions as well).
Perform Runtime Contract Checking != Full
Debug/Release: both
Using CCRewrite with Perform Runtime Contract Checking not equals to Full with async method (or methods with iterator blocks) with complex
Contract.Requires
(that hasII
or&&
in it) provides invalid assembly. Using such an assembly leads toSystem.InvalidProgramExecution
exception and peverify shows following error:Steps to reproduce:
or
In latter case if Perform Runtime Contract Checking is not Full CCRewrite produces following IL in
MoveMethod
:The text was updated successfully, but these errors were encountered: