You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue body was drafted with assistance from GitHub Copilot.
Description
BlobBuilder.LinkSuffix appears to drop previously linked content when the destination builder is empty and the suffix builder already has a linked suffix.
Minimal repro
usingSystem;usingSystem.Reflection.Metadata;staticstringHex(byte[]bytes)=>BitConverter.ToString(bytes);varemptyPrefix=newBlobBuilder(16);varelement=newBlobBuilder(16);vartail=newBlobBuilder(16);element.WriteByte(0x11);tail.WriteByte(0x22);// Pre-link element + tailelement.LinkSuffix(tail);// Then link into empty destinationemptyPrefix.LinkSuffix(element);Console.WriteLine(Hex(emptyPrefix.ToArray()));
Actual behavior
Output:
22-00
Expected behavior
Output should preserve both bytes in order:
11-22
Notes
A control case with a non-empty destination (prefix.WriteByte(0xAA) before linking) behaves as expected. The issue reproduces specifically when the destination BlobBuilder is empty.
Observed in local repro project targeting net11.0 in this repository.
Note
This issue body was drafted with assistance from GitHub Copilot.
Description
BlobBuilder.LinkSuffixappears to drop previously linked content when the destination builder is empty and the suffix builder already has a linked suffix.Minimal repro
Actual behavior
Output:
Expected behavior
Output should preserve both bytes in order:
Notes
A control case with a non-empty destination (
prefix.WriteByte(0xAA)before linking) behaves as expected. The issue reproduces specifically when the destinationBlobBuilderis empty.Observed in local repro project targeting
net11.0in this repository.