Skip to content

Commit

Permalink
Made EE tolerant to ByRef types.
Browse files Browse the repository at this point in the history
Ideally EE should not encounter ByRef types, but for now I just make EE resilient if it sees them
  • Loading branch information
VSadov committed Feb 18, 2016
1 parent a2ec4cc commit 6d02c04
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,21 @@ public TypeAndCustomInfo(DkmClrType type, DkmClrCustomTypeInfo info = null)

public Type Type
{
get { return (ClrType == null) ? null : ClrType.GetLmrType(); }
get
{
var t = ClrType?.GetLmrType();

//TODO: Sometimes we get byref types here when dealing with ref-returning members.
// That probably should not happen.
// For now we will just unwrap unexpected byrefs
if (t?.IsByRef == true)
{
t = t.GetElementType();
Debug.Assert(!t.IsByRef, "double byref type?");
}

return t;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ protected override bool IsArrayImpl()

protected override bool IsByRefImpl()
{
throw new NotImplementedException();
return Type.IsByRef;
}

protected override bool IsCOMObjectImpl()
Expand Down

0 comments on commit 6d02c04

Please sign in to comment.