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

A couple of GDScript fixes #43856

Merged
merged 2 commits into from
Nov 25, 2020
Merged

Conversation

vnen
Copy link
Member

@vnen vnen commented Nov 25, 2020

  • Fix type of range() when used in a for loop, since it's optimized to Vector2/3 or int to not allocate an array.
  • Fix the return value of a cast when compiling. It was returning the source value instead of the result.

Found those while testing the typed VM and the #43775 fix.

The call of range() in a for loop is optimized to use int or vectors, to
avoid allocating an array, however the type was set as array still. With
the new typed VM this is an issue as the type mismatch the actual value,
resulting in wrong instructions to be selected.
It was mistakenly returning the source instead of the result.
@vnen vnen added this to the 4.0 milestone Nov 25, 2020
@akien-mga akien-mga merged commit fc28de6 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