You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
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
The text was updated successfully, but these errors were encountered: