diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/EETypeNode.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/EETypeNode.cs index c3a50613b61859..1e9f7679b44cc3 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/EETypeNode.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/EETypeNode.cs @@ -790,7 +790,13 @@ protected virtual int BaseSize int pointerSize = _type.Context.Target.PointerSize; int objectSize; - if (_type.IsDefType) + if (_type.IsInterface) + { + // Interfaces don't live on the GC heap. Don't bother computing a number. + // Zero compresses better than any useless number we would come up with. + return 0; + } + else if (_type.IsDefType) { LayoutInt instanceByteCount = ((DefType)_type).InstanceByteCount;