Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix encoding span polyfills for empty spans - #570

#570
Merged
SimonCropp merged 1 commit into
SimonCropp:mainSimonCropp/Polyfill:mainfrom
thomhurst:agent/fix-encoding-empty-spansthomhurst/Polyfill:agent/fix-encoding-empty-spansCopy head branch name to clipboard
Jul 15, 2026
Merged

Fix encoding span polyfills for empty spans#570
SimonCropp merged 1 commit into
SimonCropp:mainSimonCropp/Polyfill:mainfrom
thomhurst:agent/fix-encoding-empty-spansthomhurst/Polyfill:agent/fix-encoding-empty-spansCopy head branch name to clipboard

Conversation

@thomhurst

Copy link
Copy Markdown
Contributor

Summary

  • short-circuit stateless Encoding span overloads for empty input
  • use non-null stack storage for empty destinations and stateful Encoder.Convert
  • add empty-source and empty-destination regression coverage
  • regenerate Split sources, assembly-size data, and README snippets

Root cause

Pinning an empty span produces a null pointer. The pointer-based encoding overloads reject null pointers even when the corresponding length is zero, unlike the native span overloads.

Validation

  • dotnet run --project src/ApiBuilderTests/ApiBuilderTests.csproj --configuration Debug — 71 passed
  • dotnet build src/Polyfill.slnx --configuration Release — succeeded, 0 errors
  • pwsh ./src/run-tests.ps1 — full project/framework matrix passed

Closes #569

@SimonCropp SimonCropp added this to the 11.0.1 milestone Jul 15, 2026
@SimonCropp

Copy link
Copy Markdown
Owner

nice. will deploy now

@SimonCropp
SimonCropp merged commit ebf978d into SimonCropp:main Jul 15, 2026
3 of 4 checks passed
This was referenced Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Encoding span polyfills throw on empty spans when unsafe is enabled

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.