From ad1677de45f909a995e16c692686c0d1a4d780b9 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Sun, 14 Jan 2024 11:52:20 +0100 Subject: [PATCH] Clear only necessary memory in SectionWriter.EmitSymbolReference --- .../ILCompiler.Compiler/Compiler/ObjectWriter/SectionWriter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/SectionWriter.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/SectionWriter.cs index c7a52e6bf46a96..7ccfa9651a2fc7 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/SectionWriter.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/SectionWriter.cs @@ -78,7 +78,7 @@ public readonly void EmitSymbolReference( IBufferWriter bufferWriter = _sectionData.BufferWriter; int size = relocType == RelocType.IMAGE_REL_BASED_DIR64 ? sizeof(ulong) : sizeof(uint); Span buffer = bufferWriter.GetSpan(size); - buffer.Clear(); + buffer.Slice(0, size).Clear(); _objectWriter.EmitRelocation( SectionIndex, Position,