Skip to content

fix: keep constant offset up to date - #35

Merged
cfallin merged 1 commit into
bytecodealliance:mainfrom
mattermoran:fix/constant-offset-deps
Oct 12, 2026
Merged

cfallin merged 1 commit into
bytecodealliance:mainfrom
mattermoran:fix/constant-offset-deps

Conversation

@mattermoran

Copy link
Copy Markdown
Contributor

fixes an issue where stale analysis results would incorrectly rewrite address calculations

context: after upgrading to fastly js v4 with aot the app would fail during rendering in a preact hook. tracked it down to a bound function receiving a number instead of an object. ok that's weird so digging more led here :)

as you see here when the offset changes the work queue can miss revisiting code that's using it so later it just ends up using the old offset

the test reproduces the issue without needing to run full fastly with preact etc

let me know if you'd like to fix it in a different way but it uses the same pattern already used in eval.rs

with this patch my app happily renders :)

@mattermoran
mattermoran force-pushed the fix/constant-offset-deps branch from 50b405a to 9bc6f7a Compare October 11, 2026 22:17

@cfallin cfallin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much for tracking this down! Yes, indeed, this was an analysis dependency-management bug and the fix looks good.

I'll cut a new release with this fix. I don't control the downstream Fastly SDK anymore so someone else will need to pick up the version bump details as needed there.

@cfallin
cfallin merged commit 03867ac into bytecodealliance:main Oct 12, 2026
11 checks passed
@cfallin cfallin mentioned this pull request Oct 12, 2026
@mattermoran

Copy link
Copy Markdown
Contributor Author

thank you! once 0.5.1 is out, I can submit a bump pr on fastly side

@cfallin

cfallin commented Oct 12, 2026

Copy link
Copy Markdown
Member

@mattermoran weval 0.5.1 has now been published to artifacts here, to crates.io, and to NPM (local confirmation after npm publish; seems it is still processing and isn't appearing on the registry yet though).

gkgoat1 pushed a commit to gkgoat1/weval that referenced this pull request Oct 13, 2026
- Includes bytecodealliance#35, fixing a bug in the constant-offset optimization.
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.

2 participants