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

Script that calls OptionButton add_separator() with no arguments crashes Godot on POT generation #88272

Closed
SanteriLoitomaa opened this issue Feb 13, 2024 · 1 comment · Fixed by #86471

Comments

@SanteriLoitomaa
Copy link

Tested versions

  • Found on v4.2.1.stable.official [b09f793]

System information

Godot v4.2.1.stable - Windows 10.0.19045 - GLES3 (Compatibility) - NVIDIA GeForce GTX 1650 (NVIDIA; 31.0.15.5123) - AMD Ryzen 5 3550H with Radeon Vega Mobile Gfx (8 Threads)

Issue description

A script that calls OptionButton add_separator() with no arguments crashes Godot on POT generation with the following error message:

ERROR: FATAL: Index p_index = 0 is out of bounds (size() = 0).
   at: get (./core/templates/cowdata.h:158)

Using add_separator("") works fine, making me think that there is something in the code that expects there to be a string even when it is not a required argument. The problem may thus be more widespread and actually affect all functions that expect a string as an argument but don't outright require it.

Steps to reproduce

  1. Add the following script to your Project Settings > Localization > POT Generation > Files with translation strings:
extends OptionButton


func _ready():
	add_separator()
  1. Generate POT
  2. Crash

Minimal reproduction project (MRP)

POTGenCrash.zip
Generating POT with Crash.gd included will crash Godot.
Generating POT with only NoCrash.gd will not crash Godot.

@dalexeev
Copy link
Member

dalexeev commented Feb 13, 2024

Not reproducible in 4.3 dev, fixed by #86471.

Thanks for reporting the bug nonetheless!

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

Successfully merging a pull request may close this issue.

2 participants