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

Initializing a class instance derived from another class itself derived from Reference crashes the game on reaching the line count of the firstr class, but not always. #61368

Open
Derkune opened this issue May 24, 2022 · 0 comments

Comments

@Derkune
Copy link

Derkune commented May 24, 2022

Godot version

3.4.4 stable, 3.4.2 stable, maybe others

System information

windows 10, OpenGL ES 3.0 Renderer: NVIDIA GeForce GTX 1070/PCIe/SSE2

Issue description

In the example project, class SellingWares derives from WaresDict, which itself derives from Reference. They are contained in class StationStats, itself derived from Reference. It contains two typed variables,

var buying_wares: BuyingWares = BuyingWares.new()
var selling_wares: SellingWares = SellingWares.new()

Upon being instantiated, StationStats crashes with project with this in the console:

ERROR: FATAL: Index p_index = 2 is out of bounds (((Vector<T> *)(this))->_cowdata.size() = 2).
at: operator[] (./core/vector.h:49)

When going through it step by step, you can see that StationStats correctly initializes first variable (buying_wares), but hitches on second. In it, it initializes variables up to line number equal to line count of child class. SellingWares has two lines, and initialization of WaresDict it is derived from hitches on line 3. But, this happens only on initialization of second variable of StationStats, even though the same code is executed on the first variable.

Steps to reproduce

Run the scene included, and watch the game quietly crash.

Minimal reproduction project

BugTest.zip

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

2 participants