Skip to content

fix: foreach should not break init backtracking with DUPN #3266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 5, 2025

Conversation

kanwren
Copy link
Contributor

@kanwren kanwren commented Feb 17, 2025

Simplifies the compilation of foreach to avoid the problem in #3227 by removing unnecessary FORK ... BACKTRACK. Adds a simple regression test to check that the init clause is allowed to backtrack.

Does not address reduce, which is less trivial, and may require changes to the instruction set or other tradeoffs.

@kanwren kanwren force-pushed the kanwren/foreach-dupn branch from e88fb0c to 9e11573 Compare February 17, 2025 21:55
Simplifies the compilation of `foreach` to avoid the problem in jqlang#3227 by
removing unnecessary `FORK ... BACKTRACK`.

Does not address `reduce`, which is less trivial.
@kanwren kanwren force-pushed the kanwren/foreach-dupn branch from 9e11573 to def2639 Compare February 17, 2025 22:03
@itchyny itchyny added the bug label Feb 17, 2025
Copy link
Contributor

@itchyny itchyny left a comment

Choose a reason for hiding this comment

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

LGTM, Thank you!

@itchyny itchyny merged commit c70ae1a into jqlang:master Mar 5, 2025
28 checks passed
@itchyny itchyny added this to the 1.8 release milestone Mar 5, 2025
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.

2 participants