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

GDScript: Fix mishandling of stack pointers #43775

Merged
merged 1 commit into from
Nov 25, 2020

Conversation

vnen
Copy link
Member

@vnen vnen commented Nov 22, 2020

  • Replace the for loop temporaries by locals. They cause conflicts with the stack when being popped, while locals are properly handled in the scope.
  • Change the interface for the codegen so the for loop list doesn't live through the whole block if it's a temporary.
  • Keep track of the actual amount of local variables in the stack. Using the size of the map is misleading in cases where multiple cals have the same name (which is allowed when there's no shadowing).
  • Added a few debug checks for temporaries, to avoid them being wrongly manipulated in the future. They should not live more than a line of code.
  • Rearrange some of compiler code to make sure the temporaries don't live across blocks.

@vnen vnen added this to the 4.0 milestone Nov 22, 2020
@vnen vnen marked this pull request as draft November 22, 2020 17:28
- Replace the for loop temporaries by locals. They cause conflicts with
  the stack when being popped, while locals are properly handled in the
  scope.
- Change the interface for the codegen so the for loop list doesn't live
  through the whole block if it's a temporary.
- Keep track of the actual amount of local variables in the stack. Using
  the size of the map is misleading in cases where multiple locals have
  the same name (which is allowed when there's no shadowing).
- Added a few debug checks for temporaries, to avoid them being wrongly
  manipulated in the future. They should not live more than a line of
  code.
- Rearrange some of compiler code to make sure the temporaries don't
  live across blocks.
@vnen vnen marked this pull request as ready for review November 25, 2020 14:33
@vnen
Copy link
Member Author

vnen commented Nov 25, 2020

Now this should be good to merge.

@akien-mga akien-mga merged commit a5ee8d8 into godotengine:master Nov 25, 2020
@akien-mga
Copy link
Member

Thanks!

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