Skip to content
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

mini_c: add additional renames to avoid name collision #12

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

EduardoRFS
Copy link
Contributor

@EduardoRFS EduardoRFS commented Dec 5, 2024

Context

After https://gitlab.com/ligolang/ligo/-/commit/0c580ac5a61e39cbfa4882d7dc3f7c151c97d1fa some variables are produced duplicated and we need to alpha rename before doing beta reduction.

But currently not all cases are handled, leading to some bugs such as the one below. This PR ensures that after inlining every binder is globally unique, as long as inline_let is the only source of duplication, this should prevent the entire class of bugs.

Repro

# expected = 0xab5faaaacd
# received = 0xab5faaaa5faaaa
ligo compile expression 'jsligo' 'Bytes.concat(Bytes.concat(0xab, 0x5faaaa), 0xcd)'

@EduardoRFS EduardoRFS merged commit 599e4e4 into stable Dec 10, 2024
2 checks passed
@EduardoRFS EduardoRFS deleted the fix-alpha-renaming branch December 10, 2024 16:26
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