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

UtilityFunctions::str_internal always crashes #1127

Closed
Mathis-Z opened this issue May 30, 2023 · 1 comment · Fixed by #1128
Closed

UtilityFunctions::str_internal always crashes #1127

Mathis-Z opened this issue May 30, 2023 · 1 comment · Fixed by #1128
Labels
bug This has been identified as a bug
Milestone

Comments

@Mathis-Z
Copy link
Contributor

Godot version

4.0

godot-cpp version

4.0

System information

Linux

Issue description

Calling UtilityFunctions::str(...) always crashes.

The issue seems to be that the underlying str_internal() function calls a godot interface function with a Variant variable for storing the returned value but that return value is a String instead of a Variant which crashes when the Variant variable goes out of scope at the end of str_internal().

There is a simple fix for that which is changing the type of the return variable to String. I will open a PR for that.

Steps to reproduce

Call the function with any number/type of parameters.

Minimal reproduction project

Not necessary.

Mathis-Z added a commit to Mathis-Z/godot-cpp that referenced this issue May 30, 2023
@dsnopek dsnopek added the bug This has been identified as a bug label May 31, 2023
@dsnopek
Copy link
Collaborator

dsnopek commented Jun 8, 2023

Thanks!

I'm able to reproduce the crash.

Mathis-Z added a commit to Mathis-Z/godot-cpp that referenced this issue Jun 8, 2023
akien-mga added a commit that referenced this issue Jun 8, 2023
Fixing #1127 by making return types of auto-generated functions dynamic
@akien-mga akien-mga added this to the 4.1 milestone Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This has been identified as a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants