This is a migrated thread and some comments may be shown as answers.

Exception thrown while decompiling method

2 Answers 126 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chad
Top achievements
Rank 1
Chad asked on 13 Jul 2015, 07:35 PM

 

I previously sent this in an email with the link given at the bottom of the given stack trace but never got any response. Thought I'd try here.

Error message: 
Current member / type: System.Collections.Generic.IEnumerable`1<System.Int32> TryYieldTest.Class1::Test() 
File path: C:\Projects\TryYieldTest\TryYieldTest\bin\Debug\TryYieldTest.dll 
Product version: 2015.2.623.1 
Exception in: System.Collections.Generic.IEnumerable<u<System.Int32>> Test() 

Could not determine the end ot the try block
at ..( ) in c:\Builds\245\Behemoth\ReleaseBranch Production Build\Sources\OpenSource\Cecil.Decompiler\Decompiler\LogicFlow\YieldGuardedBlocksBuilder.cs:line 136
at ..( ) in c:\Builds\245\Behemoth\ReleaseBranch Production Build\Sources\OpenSource\Cecil.Decompiler\Decompiler\LogicFlow\YieldGuardedBlocksBuilder.cs:line 76
at ..() in c:\Builds\245\Behemoth\ReleaseBranch Production Build\Sources\OpenSource\Cecil.Decompiler\Decompiler\LogicFlow\LogicalFlowBuilderStep.cs:line 126
at ..(   ) in c:\Builds\245\Behemoth\ReleaseBranch Production Build\Sources\OpenSource\Cecil.Decompiler\Decompiler\LogicFlow\LogicalFlowBuilderStep.cs:line 51
at ..(MethodBody    ILanguage ) in c:\Builds\245\Behemoth\ReleaseBranch Production Build\Sources\OpenSource\Cecil.Decompiler\Decompiler\DecompilationPipeline.cs:line 88
at ..(MethodBody  ILanguage ) in c:\Builds\245\Behemoth\ReleaseBranch Production Build\Sources\OpenSource\Cecil.Decompiler\Decompiler\DecompilationPipeline.cs:line 70
at ..(MethodBody      Func`2   ) in c:\Builds\245\Behemoth\ReleaseBranch Production Build\Sources\OpenSource\Cecil.Decompiler\Decompiler\Extensions.cs:line 112
at ..(MethodBody     ) in c:\Builds\245\Behemoth\ReleaseBranch Production Build\Sources\OpenSource\Cecil.Decompiler\Decompiler\Extensions.cs:line 146
at ..() in c:\Builds\245\Behemoth\ReleaseBranch Production Build\Sources\OpenSource\Cecil.Decompiler\Steps\RebuildYieldStatementsStep.cs:line 149
at ..Match( ) in c:\Builds\245\Behemoth\ReleaseBranch Production Build\Sources\OpenSource\Cecil.Decompiler\Steps\RebuildYieldStatementsStep.cs:line 49
at ..(   ) in c:\Builds\245\Behemoth\ReleaseBranch Production Build\Sources\OpenSource\Cecil.Decompiler\Steps\RebuildYieldStatementsStep.cs:line 20
at ..(MethodBody    ILanguage ) in c:\Builds\245\Behemoth\ReleaseBranch Production Build\Sources\OpenSource\Cecil.Decompiler\Decompiler\DecompilationPipeline.cs:line 88
at ..(MethodBody  ILanguage ) in c:\Builds\245\Behemoth\ReleaseBranch Production Build\Sources\OpenSource\Cecil.Decompiler\Decompiler\DecompilationPipeline.cs:line 70
at ..(  ILanguage  MethodBody   ) in c:\Builds\245\Behemoth\ReleaseBranch Production Build\Sources\OpenSource\Cecil.Decompiler\Decompiler\Extensions.cs:line 99
at ..(MethodBody  ILanguage     ) in c:\Builds\245\Behemoth\ReleaseBranch Production Build\Sources\OpenSource\Cecil.Decompiler\Decompiler\Extensions.cs:line 62
at ..(ILanguage  MethodDefinition   ) in c:\Builds\245\Behemoth\ReleaseBranch Production Build\Sources\OpenSource\Cecil.Decompiler\Decompiler\WriterContextServices\BaseWriterContextService.cs:line 116


_______________________________________

 

Seems to be caused by a yield break inside of a try.
Original source: 

01.using System.Collections.Generic;
02. 
03.namespace TryYieldTest
04.{
05.    public class Class1
06.    {
07.        public IEnumerable<int> Test()
08.        {
09.            int x = 0;
10. 
11.            try
12.            {
13.                while (true)
14.                {
15.                    if (x == 5)
16.                    {
17.                        yield break;
18.                    }
19.                    else
20.                    {
21.                        yield return x;
22.                    }
23.                }
24.            }
25.            finally
26.            {
27. 
28.            }
29.        }
30.    }
31.}

2 Answers, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 14 Jul 2015, 10:23 AM
Hello Chad,

Thank you for taking the time to report this bug twice.

We received your email. Back then we successfully reproduced the problem you had and we added it in our backlog. This was possible thanks to your detailed email, which contained all the needed information to reproduce the problem. Also in the email there was no question asked, so we decided to not disturb you anymore with further communication.

Please, update regularly and stay tuned.

Regards,
Alexander
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Chad
Top achievements
Rank 1
answered on 14 Jul 2015, 01:35 PM

Thanks for the prompt response. I suppose I was just expecting some kind of confirmation. Great news that it's in the queue. Please don't make me have to resort to dotPeek again, it's the worst :)

 Thanks again

Tags
General Discussions
Asked by
Chad
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Chad
Top achievements
Rank 1
Share this question
or