CABI: fix realloc alignment in string conversion - #734
Open
lukewagner wants to merge 1 commit into
Open
lukewagner wants to merge 1 commit into
lukewagner wants to merge 1 commit into
Conversation
vados-cosmonic
added a commit
to vados-cosmonic/jco
that referenced
this pull request
Sep 30, 2026
Implement the remaining string transcoders used by fused adapters, except for the utf16 copier: - Copy(Latin1) - Latin1ToUtf16 - Latin1ToUtf8 - Utf8ToLatin1 - Utf8ToCompactUtf16 - Utf16ToLatin1 - Utf16ToCompactUtf16 - Utf16ToCompactProbablyUtf16 The transcoders rely on latin1+utf16 destinations always being allocated with an alignment of 2 (see WebAssembly/component-model#734), which the adapter module already enforces after every realloc.
vados-cosmonic
added a commit
to vados-cosmonic/jco
that referenced
this pull request
Sep 30, 2026
Implement the remaining string transcoders used by fused adapters, except for the utf16 copier: - Copy(Latin1) - Latin1ToUtf16 - Latin1ToUtf8 - Utf8ToLatin1 - Utf8ToCompactUtf16 - Utf16ToLatin1 - Utf16ToCompactUtf16 - Utf16ToCompactProbablyUtf16 The transcoders rely on latin1+utf16 destinations always being allocated with an alignment of 2 (see WebAssembly/component-model#734), which the adapter module already enforces after every realloc.
vados-cosmonic
added a commit
to vados-cosmonic/jco
that referenced
this pull request
Sep 30, 2026
Implement the remaining string transcoders used by fused adapters, except for the utf16 copier: - Copy(Latin1) - Latin1ToUtf16 - Latin1ToUtf8 - Utf8ToLatin1 - Utf8ToCompactUtf16 - Utf16ToLatin1 - Utf16ToCompactUtf16 - Utf16ToCompactProbablyUtf16 The transcoders rely on latin1+utf16 destinations always being allocated with an alignment of 2 (see WebAssembly/component-model#734), which the adapter module already enforces after every realloc.
vados-cosmonic
added a commit
to vados-cosmonic/jco
that referenced
this pull request
Sep 30, 2026
Implement the remaining string transcoders used by fused adapters, except for the utf16 copier: - Copy(Latin1) - Latin1ToUtf16 - Latin1ToUtf8 - Utf8ToLatin1 - Utf8ToCompactUtf16 - Utf16ToLatin1 - Utf16ToCompactUtf16 - Utf16ToCompactProbablyUtf16 The transcoders rely on latin1+utf16 destinations always being allocated with an alignment of 2 (see WebAssembly/component-model#734), which the adapter module already enforces after every realloc.
vados-cosmonic
added a commit
to vados-cosmonic/jco
that referenced
this pull request
Sep 30, 2026
Implement the remaining string transcoders used by fused adapters, except for the utf16 copier: - Copy(Latin1) - Latin1ToUtf16 - Latin1ToUtf8 - Utf8ToLatin1 - Utf8ToCompactUtf16 - Utf16ToLatin1 - Utf16ToCompactUtf16 - Utf16ToCompactProbablyUtf16 The transcoders rely on latin1+utf16 destinations always being allocated with an alignment of 2 (see WebAssembly/component-model#734), which the adapter module already enforces after every realloc.
vados-cosmonic
added a commit
to vados-cosmonic/jco
that referenced
this pull request
Sep 30, 2026
Implement the remaining string transcoders used by fused adapters, except for the utf16 copier: - Copy(Latin1) - Latin1ToUtf16 - Latin1ToUtf8 - Utf8ToLatin1 - Utf8ToCompactUtf16 - Utf16ToLatin1 - Utf16ToCompactUtf16 - Utf16ToCompactProbablyUtf16 The transcoders rely on latin1+utf16 destinations always being allocated with an alignment of 2 (see WebAssembly/component-model#734), which the adapter module already enforces after every realloc.
vados-cosmonic
added a commit
to vados-cosmonic/jco
that referenced
this pull request
Oct 1, 2026
Implement the remaining string transcoders used by fused adapters, except for the utf16 copier: - Copy(Latin1) - Latin1ToUtf16 - Latin1ToUtf8 - Utf8ToLatin1 - Utf8ToCompactUtf16 - Utf16ToLatin1 - Utf16ToCompactUtf16 - Utf16ToCompactProbablyUtf16 The transcoders rely on latin1+utf16 destinations always being allocated with an alignment of 2 (see WebAssembly/component-model#734), which the adapter module already enforces after every realloc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As reported in #733, after #54, there's still a case where string reallocation (of a
latin1+utf16string) still specifies the wrong alignment passed to thereallocfunction. In addition to fixing this, this PR also factors out the alignment and bounds traps which #680 now makes possible.