Bug 17194 - TypeDefinition.Properties returns invalid data
Summary: TypeDefinition.Properties returns invalid data
Status: RESOLVED INVALID
Alias: None
Product: Class Libraries
Classification: Mono
Component: Cecil ()
Version: master
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-01-12 05:59 UTC by Lex Li
Modified: 2014-02-04 03:45 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description Lex Li 2014-01-12 05:59:04 UTC
Running unit test case in SkipPropertyTests.cs of obfuscar (https://github.com/lextm/obfuscar), an exception occurs,

Test Name:	CheckDropsProperties
Test FullName:	ObfuscarTests.SkipPropertyTests.CheckDropsProperties
Test Source:	e:\Projects\sharpmibsuite\obfuscar\Obfuscar\ObfuscarTests\SkipPropertyTests.cs : line 77
Test Outcome:	Failed
Test Duration:	0:00:00.081

Result Message:	System.ArgumentException : Value does not fall within the expected range.
Result StackTrace:	
at Mono.Cecil.MetadataReader.GetMember[TMember](Collection`1 members, MetadataToken token) in e:\Projects\sharpmibsuite\obfuscar\cecil\Mono.Cecil\AssemblyReader.cs:line 1569
at Mono.Cecil.MetadataReader.GetProperty(TypeDefinition type, MetadataToken token) in e:\Projects\sharpmibsuite\obfuscar\cecil\Mono.Cecil\AssemblyReader.cs:line 1558
at Mono.Cecil.MetadataReader.ReadMethodSemantics(MethodDefinition method) in e:\Projects\sharpmibsuite\obfuscar\cecil\Mono.Cecil\AssemblyReader.cs:line 1508
at Mono.Cecil.MetadataReader.ReadAllSemantics(TypeDefinition type) in e:\Projects\sharpmibsuite\obfuscar\cecil\Mono.Cecil\AssemblyReader.cs:line 1617
at Mono.Cecil.MetadataReader.ReadAllSemantics(MethodDefinition method) in e:\Projects\sharpmibsuite\obfuscar\cecil\Mono.Cecil\AssemblyReader.cs:line 1604
at Mono.Cecil.MethodDefinition.<ReadSemantics>b__0(MethodDefinition method, MetadataReader reader) in e:\Projects\sharpmibsuite\obfuscar\cecil\Mono.Cecil\MethodDefinition.cs:line 88
at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func`3 read) in e:\Projects\sharpmibsuite\obfuscar\cecil\Mono.Cecil\ModuleDefinition.cs:line 787
at Mono.Cecil.MethodDefinition.ReadSemantics() in e:\Projects\sharpmibsuite\obfuscar\cecil\Mono.Cecil\MethodDefinition.cs:line 88
at Mono.Cecil.MethodDefinition.get_SemanticsAttributes() in e:\Projects\sharpmibsuite\obfuscar\cecil\Mono.Cecil\MethodDefinition.cs:line 66
at Obfuscar.Obfuscator.RenameMethods() in e:\Projects\sharpmibsuite\obfuscar\Obfuscar\Obfuscator.cs:line 980
at ObfuscarTests.TestHelper.Obfuscate(String xml) in e:\Projects\sharpmibsuite\obfuscar\Obfuscar\ObfuscarTests\TestHelper.cs:line 81
at ObfuscarTests.TestHelper.BuildAndObfuscate(String name, String suffix, String xml) in e:\Projects\sharpmibsuite\obfuscar\Obfuscar\ObfuscarTests\TestHelper.cs:line 92
at ObfuscarTests.SkipPropertyTests.CheckDropsProperties() in e:\Projects\sharpmibsuite\obfuscar\Obfuscar\ObfuscarTests\SkipPropertyTests.cs:line 87

This only happens when upgrading to latest cecil build SHA-1: f4a15b8cee24cfeaa0f304589839243be51f5b44. When an old build is used this test case passes, SHA-1: aea2ceb687f989670d31db5232c77d089b0124ca.
Comment 1 Lex Li 2014-02-04 03:45:38 UTC
Just checked latest revision and this issue is gone.