godot
godot copied to clipboard
Fix ptrcalls to static GDExtension methods
This was noticed during a short discussion on RocketChat.
GDScript is apparently never making any validated calls to static methods, which has meant that this bug hasn't been triggered up until now.
However, if anything were to make a validated call or ptrcall to a static GDExtension method it would have segfaulted.
This PR should fix that!
After thinking about this code for a little bit, I decided to sneak one tiny additional thing in here. It was sort of silly that validated_call()
was calling into ptrcall()
, which has just one line of functional code, aside from the ERR_*()
macros and getting the extension instance, all of which we've already done in validated_call()
. So, I copied that one line up into validated_call()
itself. This will likely be a very minor performance improvement.
Thanks!