On Mon, Jan 2, 2012 at 4:50 AM, vishnu <vishnu....@gmail.com> wrote:
> [INFO] [11:05:47.246] An uncaught exception occured. Please fill a bug
> report at https://bugzilla.novell.com/
> [INFO] [11:05:47.246] Stack trace: System.ArgumentOutOfRangeException:
> Specified argument was out of the range of valid values.
> [INFO] [11:05:47.246] at
> Mono.Collections.Generic.Collection`1.get_Item(Int32 index)
> [INFO] [11:05:47.246] at
> Gendarme.Framework.Symbols.ExtractFirst(MethodDefinition method)
> [INFO] [11:05:47.246] at
> Gendarme.Framework.Symbols.ExtractFirst(TypeDefinition type)
> [INFO] [11:05:47.246] at
> Gendarme.Framework.Symbols.GetSource(Defect defect)
> [INFO] [11:05:47.246] at Gendarme.Framework.Defect.get_Source()
> [INFO] [11:05:47.246] at
This stack trace seems to indicate that you have a method with the
HasBody flag, but which doesn't have any Instruction.
Could you verify that this assumption is true?
I'll fix gendarme to not crash on this anyway.
Jb
.class interface public abstract auto ansi import P2ClientGateMTA.IP2BLMessage
{
.custom instance void [mscorlib]System.Runtime.InteropServices.TypeIdentifierAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 41 38 35 42 43 37 41 33 2D 39 43 45 34 // ..$A85BC7A3-9CE4
2D 34 32 39 45 2D 41 33 37 30 2D 35 38 37 35 44 // -429E-A370-5875D
45 46 45 42 33 45 39 00 00 ) // EFEB3E9..
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
} // end of class P2ClientGateMTA.IP2BLMessage
--You received this message because you are subscribed to the Google Groups "Gendarme" group.To post to this group, send email to gend...@googlegroups.com.To unsubscribe from this group, send email to gendarme+u...@googlegroups.com.For more options, visit this group at http://groups.google.com/group/gendarme?hl=en.
You can run on your assembly a piece of code using Cecil like:
var module = ModuleDefinition.ReadModule("MyAssembly.dll");
foreach (var method in module.GetTypes().SelectMany(t =>
t.Methods).Where(m => m.HasBody && m.Body.Instructions.Count == 0)) {
Console.WriteLine ("Method with empty body: {0}", method);
}
And you'll have the names of actual methods with empty bodies.
Jb
This is a Microsoft C# compiler bug:
They emit managed methods which claim to be managed but are actually
implemented by the runtime. Not that they care a lot.
I committed a fix to gendarme
(1fbb7ea90bbb96d2d28f9567ec7dee8dc735cfc7), you can either build
gendarme yourself or have the sonar guys cherry-pick this fix.
Jb
Gendarme official releases occurs at the same time as Mono releases.
The beta cycle for 2.11 should start soon - but we're a few months
away from a stable 2.12.
Sebastien
I see,
Jb
> For more options, visit this group at
> http://groups.google.com/group/gendarme?hl=en.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Gendarme" group.
> To post to this group, send email to gend...@googlegroups.com.
> To unsubscribe from this group, send email to