| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
TODO:
|
Sorry, something went wrong.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## master #8477 +/- ##
=======================================
Coverage 74.42% 74.42%
=======================================
Files 451 451
Lines 61459 61459
=======================================
Hits 45743 45743
Misses 15716 15716
|
Sorry, something went wrong.
|
rescript
npm i https://pkg.pr.new/rescript@8477
npm i https://pkg.pr.new/@rescript/darwin-arm64@8477
npm i https://pkg.pr.new/@rescript/darwin-x64@8477
npm i https://pkg.pr.new/@rescript/linux-arm64@8477
npm i https://pkg.pr.new/@rescript/linux-x64@8477
npm i https://pkg.pr.new/@rescript/runtime@8477
npm i https://pkg.pr.new/@rescript/win32-x64@8477 commit: afe469c |
Sorry, something went wrong.
Keep new for...of typedtree and parsetree constructors at the end of their variants so existing marshalled constructor tags remain stable for v12 artifacts. Allow CMT readers to accept explicitly supported older magic numbers while still writing a new magic for current artifacts.
|
Ready for review!! |
Sorry, something went wrong.
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: afe469c6c9 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Sorry, something went wrong.
There was a problem hiding this comment.
Great catch!
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
This fixes an analysis/LSP crash when a v13 analysis binary reads v12 .cmt/.cmti files.
It moves the new for...of typedtree and parsetree constructors to the end of their variants so v12 marshalled constructor tags remain stable.
Root Cause
Editor analysis reads compiled .cmt files directly. Those files are OCaml Marshal payloads containing typedtree data, so variant constructors are decoded by their runtime constructor tag/index, not by constructor name.
The for...of implementation added new constructors in the middle of existing variants:
That shifted the numeric tags for existing constructors after Texp_for / Pexp_for. When v13 analysis accepted or tried to read v12 CMT files, an old constructor such as Texp_send could be decoded as Texp_for_of. The payload layout is different, so Tast_iterator could then read invalid values and segfault instead of raising a catchable OCaml exception.
Why This Fix Works
Appending the new constructors preserves the tags and payload layout for every constructor that already existed in v12. That means v13 can safely read v12 CMTs for old syntax, while v13-generated artifacts can still use the new for...of constructors.
Close #8475