godot-cpp icon indicating copy to clipboard operation
godot-cpp copied to clipboard

Fix crash in `ClassDB::add_virtual_method()` if arguments metadata is the wrong size

Open dsnopek opened this issue 1 year ago • 1 comments

Fixes https://github.com/godotengine/godot-cpp/issues/1580

However, this shouldn't ever happen, if developers use the GDVIRTUAL*() macros, which will always call this with arguments metadata of the correct size.

dsnopek avatar Sep 12 '24 14:09 dsnopek

If I understand it correctly, the handled failure case here would be a developer error. I would argue instead of silently failing, we should check for argument congruity before the loop and hard-fail on problems instead. Or at least, log an error if a problem is detected.

Ivorforce avatar Oct 16 '24 21:10 Ivorforce

Discussed at the GDExtension meeting: we agreed on adding a warning if the argument and argument metadata count don't match.

dsnopek avatar Oct 29 '24 17:10 dsnopek

Added a warning as discussed at the meeting

dsnopek avatar Oct 29 '24 18:10 dsnopek

Cherry-picked for 4.3 in PR https://github.com/godotengine/godot-cpp/pull/1695

dsnopek avatar Jan 27 '25 23:01 dsnopek