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

Fix stack overflow in setter #47672

Merged
merged 1 commit into from
Apr 7, 2021

Conversation

Blackiris
Copy link
Contributor

@Blackiris Blackiris commented Apr 6, 2021

Closes #47662
where a Stack overflow happens in the setter.

Currently, if a variable has a setter, every occurrence of its assignments are replaced by the setter, even in its own setter method, thus creating a stack overflow error where the setter method is calling itself recursively.
The is_in_setter = setter_function == codegen.function_name; should detect if the assignement happens in its setter or not, but codegen.function_name is undefined.

This fix fills the codegen.function_name, thus avoiding the bug.

@Blackiris Blackiris requested a review from a team as a code owner April 6, 2021 17:29
@Calinou Calinou added this to the 4.0 milestone Apr 6, 2021
@akien-mga akien-mga merged commit 73a1253 into godotengine:master Apr 7, 2021
@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.

GDScript 2.0: Stack overflow in setter
4 participants