Skip to content

matching: fix some non-deterministic code generation - #14091

Merged
nojb merged 1 commit into
ocaml:trunkfrom
gasche:non-deterministic-matching-compilation-14088
Jul 9, 2025
Merged

matching: fix some non-deterministic code generation#14091
nojb merged 1 commit into
ocaml:trunkfrom
gasche:non-deterministic-matching-compilation-14088

Conversation

@gasche

@gasche gasche commented Jun 18, 2025

Copy link
Copy Markdown
Member

fixes #14088 , following the rescript fix by @cristianoc

@gasche
gasche force-pushed the non-deterministic-matching-compilation-14088 branch 2 times, most recently from d5dd594 to 2ba5fca Compare June 18, 2025 12:02

@lthls lthls left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks correct.

I was actually surprised to see this transformation here, as the native middle-end has to perform the reverse transformation anyway (i.e. place the failaction back into the constant/non-constant cases).
But I suspect bytecode compilation benefits from this, so I guess it makes sense to keep it.

@gasche
gasche force-pushed the non-deterministic-matching-compilation-14088 branch from 2ba5fca to aa44d44 Compare June 30, 2025 08:10
fixes ocaml#14088

Reported-by: Christiano Calgano <cristianoc@users.noreply.github.com>
Co-authored-by: Christiano Calgano <cristianoc@users.noreply.github.com>
@gasche
gasche force-pushed the non-deterministic-matching-compilation-14088 branch from aa44d44 to b63340d Compare June 30, 2025 08:12
@gasche

gasche commented Jun 30, 2025

Copy link
Copy Markdown
Member Author

Thanks! I rebased. I put it in the 5.4 changelog as I intend to cherry-pick in the release branch.

@nojb
nojb merged commit dce8e77 into ocaml:trunk Jul 9, 2025
24 checks passed
nojb pushed a commit that referenced this pull request Jul 9, 2025
@nojb

nojb commented Jul 9, 2025

Copy link
Copy Markdown
Contributor

Cherry-picked to 5.4 f9ec868

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Apparent nondeterministic compilation of certain pattern matching examples.

3 participants