Skip to content

Make imap_go eval rule lazy in index argument (copy #2543) #2947

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

Closed
wants to merge 1 commit into from

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Apr 28, 2025

Fixes #2542

The problem was that in the final recursive call, when imap_go would return Nil, the index argument was out-of-bounds. And because imap_go was strict in all arguments, imap_go would make the Nil undefined.

Subsequently applying reverse where the Nil is undefined, gives us a complete vector that is undefined, given that reverse is strict in its vector argument.

Still TODO:

  • Write a changelog entry (see changelog/README.md)
  • Check copyright notices are up to date in edited files

This is an automatic copy of pull request #2543 done by [Mergify](https://mergify.com).

Fixes #2542

The problem was that in the final recursive call, when `imap_go`
would return `Nil`, the index argument was out-of-bounds. And
because `imap_go` was strict in all arguments, `imap_go` would
make the `Nil` undefined.

Subsequently applying `reverse` where the `Nil` is undefined,
gives us a complete vector that is undefined, given that
`reverse` is strict in its vector argument.

(cherry picked from commit a1dacb4)

# Conflicts:
#	clash-ghc/src-ghc/Clash/GHC/Evaluator/Primitive.hs
#	tests/Main.hs
@mergify mergify bot added the conflicts label Apr 28, 2025
Copy link
Contributor Author

mergify bot commented Apr 28, 2025

Cherry-pick of a1dacb4 has failed:

On branch mergify/copy/1.8/pr-2543
Your branch is up to date with 'origin/1.8'.

You are currently cherry-picking commit a1dacb46.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   clash-ghc/src-ghc/Clash/GHC/Evaluator/Primitive.hs
	both modified:   tests/Main.hs

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@martijnbastiaan
Copy link
Member

I'll fix the conflicts after merging #2946. I'll also add that PR on top.

@martijnbastiaan
Copy link
Member

This has been backported already.

@martijnbastiaan martijnbastiaan deleted the mergify/copy/1.8/pr-2543 branch May 6, 2025 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants