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

Casting to string makes the whole script fail in release build #42127

Closed
KoBeWi opened this issue Sep 16, 2020 · 4 comments
Closed

Casting to string makes the whole script fail in release build #42127

KoBeWi opened this issue Sep 16, 2020 · 4 comments

Comments

@KoBeWi
Copy link
Member

KoBeWi commented Sep 16, 2020

Godot version:
6f4384f

Steps to reproduce:

  1. Add some Sprite node with a script
  2. Put this code
func _ready() -> void:
	modulate = Color.red
	var a = 1.5
	var b = str(a)
	modulate = Color.blue
  1. The sprite doesn't change color at all in release build

If you do var b = a it works fine.
Not sure about other conversions.

@DavidSichma
Copy link
Contributor

Most built-in functions can not be called in release build as there is a function call validation that requires information only available from DEBUG_ENABLED.

validate_call_arg(function_info, p_call);
validate_call_arg compares argument count and type, even without DEBUG_ENABLED. It gets information about the function to call from few lines above
MethodInfo function_info = GDScriptFunctions::get_info(builtin_function);
however get_info returns no information without DEBUG_ENABLED so comparing argument counts fails.

removing validate_call_arg from release builds solves the issue, but I do not know what kind of validations are still expected to run in release builds.

@DavidSichma
Copy link
Contributor

broken builtins have been reported here (#41706) but issue remained unresolved

@JestemStefan
Copy link
Contributor

JestemStefan commented Aug 10, 2021

Can't reproduce in https://downloads.tuxfamily.org/godotengine/testing/4.0/4.0-dev.20210727/

Here is a project with exports for Windows and Linux. (I couldn't export for macOS or some reason)
I tested Windows and it works just fine.
obraz

I'm looking for someone with Linux to test

https://drive.google.com/drive/folders/1fZLyHgh6b7o5hQ6VUa622w4p_SsCgRTM?usp=sharing

I hope it helps!

@akien-mga
Copy link
Member

Confirmed, it seems to work fine in 6882280.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants