diff --git a/src/Perf/IIDOptimizer/SignatureEmitter.cs b/src/Perf/IIDOptimizer/SignatureEmitter.cs index ff7a7be25..803eea159 100644 --- a/src/Perf/IIDOptimizer/SignatureEmitter.cs +++ b/src/Perf/IIDOptimizer/SignatureEmitter.cs @@ -227,14 +227,14 @@ private void GenerateGuidFactoryFromComplexSignature(TypeDefinition implementati case StringStep(string str): { byte[] segmentBytes = Encoding.UTF8.GetBytes(str); - var staticDataField = new FieldDefinition($"", FieldAttributes.Private | FieldAttributes.InitOnly | FieldAttributes.Static | FieldAttributes.HasFieldRVA, CecilExtensions.GetOrCreateDataBlockType(implementationDetailsType, segmentBytes.Length)) + var staticDataField = new FieldDefinition($"{describedType.FullName}", FieldAttributes.Private | FieldAttributes.InitOnly | FieldAttributes.Static | FieldAttributes.HasFieldRVA, CecilExtensions.GetOrCreateDataBlockType(implementationDetailsType, segmentBytes.Length)) { InitialValue = segmentBytes }; - cacheType.Fields.Add(staticDataField); + implementationDetailsType.Fields.Add(staticDataField); // Load a ReadOnlySpan of the signature segment into the local for this step. - il.Emit(OpCodes.Ldsflda, new FieldReference(staticDataField.Name, staticDataField.FieldType, selfInstantiatedCacheType)); + il.Emit(OpCodes.Ldsflda, new FieldReference(staticDataField.Name, staticDataField.FieldType, implementationDetailsType)); il.Emit(OpCodes.Ldc_I4, segmentBytes.Length); il.Emit(OpCodes.Newobj, readOnlySpanOfBytePtrCtor); il.Emit(OpCodes.Stloc, signatureParts[i]);