The Module of the Instruction's Operand is incorrect #109
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When you load an assembly, get one of its methods and look for a method which has a Mono.Cecil.MethodReference operand, then the operand's DeclarintType.Module will be incorrectly the module where the method (and not the operand) is.
Example:
Assembly1.MainModule.Type1.Method1 has a Mono.Cecil.Cil.Instruction which is a Mono.Cecil.Cil.Code.Callvirt. It's operand is a Mono.Cecil.MethodReference. The method is located in Assembly2.MainModule.Type2. It's called Method2.
When we get to the call, the Operand's DeclaringType is correctly has the right full name "Namespace.Type2", and the Operand's .Name property is also correct (Method2).
The problem is, that the Operand's DeclarintType.Module does not return the right module (Assembly2.MainModule), but returns the method's module which we read the instructions from (Assembly1.MainModule).
I think it's similar to issue #79.
Drop me a line if you need code samples. Keep up the good work, Cecil rocks!
No it's not :)
http://stackoverflow.com/questions/6832503/mono-cecil-module-of-basetype-is-incorrect
Wow, that was the quickest response I've ever got to a bugreport :) Thanks mate, it works with the Scope and AssemblyResolver!