I think I figured out a fix. Please feel free to add it to the Cecil
codebase.
Add the following two lines in ReadType of SignatureReader.cs
case ElementType.ByRef:
return ReadType(data, start, out start);
Thanks,
Chris.
On Feb 26, 4:40 pm, chris <[email protected]> wrote:
> In the method GetTypeRefFromSig in ReflectionReader.cs, whenever the
> parameter t has ElementType which is ElementType.ByRef, a null is
> returned. This causes a problem because from the method
> ReadProperties, there is a call to GetTypeRefFromSig which sets the
> propertyType of pdef. If this is null and subsequently is passed onto
> GetModifierType (psig.CustomMods, pdef.PropertyType) as it happens in
> ReadProperties, a call to new ModifierOptional (ret, modType); in
> GetModifierType results in the elementType of ModifierOptional being
> null.
>
> Shouldn't ElementType.ByRef be handled in ReflectionReader? If not,
> can a ModifierOptional object have null as its elementType?
>
> Thanks,
> Chris.
--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---