Skip to content

Commit

Permalink
check that object is in a cor lib assembly
Browse files Browse the repository at this point in the history
  • Loading branch information
ds5678 committed Mar 28, 2022
1 parent bbfdddb commit 46ad5cc
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ public override IMethodDefOrRef ImportMethod(IMethodDefOrRef method)
/// <inheritdoc />
protected override ITypeDefOrRef ImportType(TypeReference type)
{
return type.Namespace == "System" && type.Name == nameof(System.Object)
return type.Namespace == "System"
&& type.Name == nameof(System.Object)
&& (type.Module?.Assembly?.IsCorLib ?? false)
? _context.Module.CorLibTypeFactory.Object.Type
: base.ImportType(type);
}
Expand Down

0 comments on commit 46ad5cc

Please sign in to comment.