-
-
Notifications
You must be signed in to change notification settings - Fork 743
Almost all operator[](int64_t p_index) can return null pointer reference #1948
Copy link
Copy link
Open
Description
Godot version
master
godot-cpp version
master
System information
linux
Issue description
Seems like godot-cpp relied on a native error logging before, but it was removed in godotengine/godot#66185 , and instead index operators now silently return nullptr. godot-cpp doesn't check for it and can silently dereference it, so the next time you access it, it will crash. I think this affects all arrays, both normal and packed. And also String... dictionary seems fine so far.
I guess this just needs a better error message and/or crash at this place specifically. As it's really unexpected to silently return invalid reference to nullptr, because this in itself won't cause a crash, but the next access to any of its member will.
Steps to reproduce
Use [] to access any element outside of valid range.
Minimal reproduction project
N/A
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels