From dfa5cf88c5f9d2dd1d42939ce11dc234b89470d5 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 9 Apr 2026 13:07:38 +0200 Subject: [PATCH] Fix browser-wasm library tests broken by webcil V1 version bump WebcilConverter and WebcilReader still use the V0 28-byte header format but were picking up WC_VERSION_MAJOR=1 from the shared Webcil.cs constant, causing webcildecoder to misparse section headers. Pin both to V0. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/tasks/Microsoft.NET.WebAssembly.Webcil/WebcilConverter.cs | 2 +- src/tasks/Microsoft.NET.WebAssembly.Webcil/WebcilReader.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tasks/Microsoft.NET.WebAssembly.Webcil/WebcilConverter.cs b/src/tasks/Microsoft.NET.WebAssembly.Webcil/WebcilConverter.cs index b43484c9534d2a..3e89fc8ed67e71 100644 --- a/src/tasks/Microsoft.NET.WebAssembly.Webcil/WebcilConverter.cs +++ b/src/tasks/Microsoft.NET.WebAssembly.Webcil/WebcilConverter.cs @@ -117,7 +117,7 @@ public unsafe void GatherInfo(PEReader peReader, out WCFileInfo wcInfo, out PEFi var sections = headers.SectionHeaders; WebcilHeader header = default; header.Id = WebcilConstants.WEBCIL_MAGIC; - header.VersionMajor = WebcilConstants.WC_VERSION_MAJOR; + header.VersionMajor = 0; // WASM-TODO: add webcil V1 support header.VersionMinor = WebcilConstants.WC_VERSION_MINOR; header.CoffSections = (ushort)coffHeader.NumberOfSections; header.Reserved0 = 0; diff --git a/src/tasks/Microsoft.NET.WebAssembly.Webcil/WebcilReader.cs b/src/tasks/Microsoft.NET.WebAssembly.Webcil/WebcilReader.cs index c81beb4e8d53ad..b3ab88d218fc4c 100644 --- a/src/tasks/Microsoft.NET.WebAssembly.Webcil/WebcilReader.cs +++ b/src/tasks/Microsoft.NET.WebAssembly.Webcil/WebcilReader.cs @@ -79,7 +79,7 @@ private unsafe bool ReadHeader() header.PeDebugSize = BinaryPrimitives.ReverseEndianness(header.PeDebugSize); } if (header.Id != WebcilConstants.WEBCIL_MAGIC - || header.VersionMajor != WebcilConstants.WC_VERSION_MAJOR + || header.VersionMajor != 0 // WASM-TODO: add webcil V1 support || header.VersionMinor != WebcilConstants.WC_VERSION_MINOR) { return false;