Skip to content

Conversation

jberthold
Copy link
Member

Before creating a reference or pointer, the pointee is evaluated using #traverseProjection and then the projections are reconstructed. This shortens out all Deref projections, avoiding the problem of creating a reference with offset -1 (which can only happen when the returned value refers to another local reference or pointer and is dereferenced immediately).

@Stevengre
Copy link
Contributor

I've been thinking about whether changing from a function to a rewriting rule is really necessary. It feels like interim_simplification is maybe the more crucial part here? Naturally, if the intermediate steps can't be produced by rewriting, then interim_simplification won't be able to do anything. I'm just wondering if we need to double-check this.

@jberthold jberthold marked this pull request as ready for review August 18, 2025 09:06
@jberthold
Copy link
Member Author

I've been thinking about whether changing from a function to a rewriting rule is really necessary. It feels like interim_simplification is maybe the more crucial part here? Naturally, if the intermediate steps can't be produced by rewriting, then interim_simplification won't be able to do anything. I'm just wondering if we need to double-check this.

Re-tested it to be sure, and indeed the symbolic-args-fail test starts to become slow when mkRef and mkPtr are functions, even with --interim-simplification 50.

Copy link
Contributor

@Stevengre Stevengre left a comment

Choose a reason for hiding this comment

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

LGTM!

@jberthold jberthold merged commit 6d853fa into master Aug 18, 2025
5 checks passed
@jberthold jberthold deleted the HOTFIX-avoid-deref-in-refs branch August 18, 2025 23:15
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