Repository navigation
test: pin every enum case in every position, both directions - #237
Open
robfischer1 wants to merge 1 commit into
Open
robfischer1 wants to merge 1 commit into
robfischer1 wants to merge 1 commit into
Conversation
Stock gravity 0.0.3 (2dc1000, the commit the spike patched) stored an enum into guest memory through I32Store8's 0/1 switch, written for bool, and panicked on any discriminant of 2 or more: panic: invalid int8 value encountered (recovered by wazero) Upstream fixed the store in arcjet#228 (8119322, 2026-10-03), which this fork imports, so this commit adds no code: it pins the fix across every position an enum takes, which arcjet#228's memory example covers only as a record field. A five-case enum crosses a flat parameter and result, a list, a record field and an option on the export side, and an import's parameter, result, list<record> result and option on the host side. Tests: the enum-discriminants example's TestEveryCaseInEveryPosition and TestEveryCaseInLists. Measured against bindings from stock 2dc1000: the generation and go vet pass and TestEveryCaseInEveryPosition/2 fails with the panic above. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
#228 fixed the
I32Store8panic for a discriminant of 2 or more:The memory example covers it as a record field. This PR adds a five-case enum through every position, in both directions:
list<record>result and an option.Measured against
2dc1000:TestEveryCaseInEveryPosition/2fails with the panic.🤖 Generated with Claude Code
https://claude.ai/code/session_01K99bnsYaj3w4MMWSF5hTMu