-
-
Notifications
You must be signed in to change notification settings - Fork 626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System.IndexOutOfRangeException at Mono.Cecil.MetadataReader.ReadLocalConstant in certain pdb #773
Comments
@ashmind thank you for filing this and providing a repro! I'll have a look! |
@ashmind out of curiosity, do you have the source for the TestAssembly? That doesn't look like regular C#, and the local constant record doesn't look like it's been properly generated, it says it's a string constant but it has no value. I can fix it to interpret this as a null string value, but the IL does a |
Thanks! The source is using System;
const string value = "";
int.TryParse(value, out var _); when built with Roslyn directly (Microsoft.CodeAnalysis.CSharp 3.10.0). Unfortunately I can't quickly check if building same with MSBuild and command line compiler produces the same (might depend on the version of course). |
Oh it's ok, just a misunderstanding on my side of things, the entry is indeed valid. I've pushed an actual fix in #776. |
Thank you for your work on this project!
I have found an issue where Cecil crashes when trying to load a certain dll+pdb.
Here is a minimal example project to reproduce this, using Cecil 0.11.3:
Bugs.Cecil.IndexOutOfRangeExceptionAtReadLocalConstant.zip
When I run it, I get a crash with
The text was updated successfully, but these errors were encountered: