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

Assignment in every branch still reconstructs original assignment #802

Closed
Ellpeck opened this issue May 18, 2024 · 1 comment
Closed

Assignment in every branch still reconstructs original assignment #802

Ellpeck opened this issue May 18, 2024 · 1 comment
Assignees
Labels
bug Something isn't working static slicing Related to slicing the source code statically

Comments

@Ellpeck
Copy link
Member

Ellpeck commented May 18, 2024

x <- 1
if(x) {
  if(y) {
    x <- 3
  } else {
    x <- 2
  }
} else {
  x <- 4
}
print(x)

results in the first line (x <- 1) still being part of the slice, even though x is overwritten in every branch.

@Ellpeck Ellpeck added bug Something isn't working static slicing Related to slicing the source code statically labels May 18, 2024
@EagleoutIce
Copy link
Member

On a second look, this is the fault of the piece of code.
the first condition if(x) causes x <- 1 to be included.
Please re-insert the test as a part of #800, but modify the condition accordingly @Ellpeck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working static slicing Related to slicing the source code statically
Projects
None yet
Development

No branches or pull requests

2 participants