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

Variable scoping bug #375

Closed
therontarigo opened this issue May 6, 2024 · 0 comments · Fixed by #407
Closed

Variable scoping bug #375

therontarigo opened this issue May 6, 2024 · 0 comments · Fixed by #407

Comments

@therontarigo
Copy link
Contributor

Testing with --no-inlining, else the problem is masked by inlining.
Input:

  vec2 r;
  int i=1;
  for (int i=2; i<3; i++) r.x=i;
  r.y=i;

Output:

  vec2 f;
  int m=1,i=2;
  for(;i<3;i++)
    f.x=i;
  f.y=i;

The last line should be f.y=m;

before 5b8f945:

  vec2 f;
  int m=1;
  for(int i=2;i<3;i++)
    f.x=i;
  f.y=m;
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 a pull request may close this issue.

1 participant