Skip to content

Fix stack overflow translating huge variant - #14355

Merged
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
alexcrichton:fix-stack-overflow
Sep 18, 2026
Merged

alexcrichton merged 1 commit into
bytecodealliance:mainfrom
alexcrichton:fix-stack-overflow

Conversation

@alexcrichton

Copy link
Copy Markdown
Member

This commit fixes a stack overflow when translating a variant from one component to another when it contains more than 1000 cases. This caused FACT to determine that an outlined helper was necessary but the helper ended up just delegating to itself since it determined that there wasn't ever enough fuel to translate the variant. The fix here is to treat the initial-fuel case as special and always able to translate at least one type to ensure that some translation progress is always made.

Closes #14354

This commit fixes a stack overflow when translating a variant from one
component to another when it contains more than 1000 cases. This caused
FACT to determine that an outlined helper was necessary but the helper
ended up just delegating to itself since it determined that there wasn't
ever enough fuel to translate the variant. The fix here is to treat the
initial-fuel case as special and always able to translate at least one
type to ensure that some translation progress is always made.

Closes bytecodealliance#14354
@alexcrichton
alexcrichton requested a review from a team as a code owner September 18, 2026 14:58
@alexcrichton
alexcrichton requested review from dicej and removed request for a team September 18, 2026 14:58
@alexcrichton
alexcrichton added this pull request to the merge queue Sep 18, 2026
Merged via the queue into bytecodealliance:main with commit 7ad2e73 Sep 18, 2026
54 checks passed
@alexcrichton
alexcrichton deleted the fix-stack-overflow branch September 18, 2026 17:29
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.

Component adapter recurses indefinitely for variants exceeding the outlining fuel budget

2 participants