diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2022-07-03 21:11:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-03 21:11:35 +0200 |
commit | 794dea0dd75ed6e914a5d774d728c2eb670656cc (patch) | |
tree | d050ce3ef11709974583df6ba8ec666ce98865bc /include/godot_cpp | |
parent | d8a65edc4a681433fc3c2f0a19dee783ca6015df (diff) | |
parent | d894f48f25f745ae5db54a3afdb240a99df4bae7 (diff) | |
download | redot-cpp-794dea0dd75ed6e914a5d774d728c2eb670656cc.tar.gz |
Merge pull request #778 from alessandrofama/4.x_fix_static_no_return
Fix crash when using static methods without return value due to uninitialized GDNativePropertyInfo struct members
Diffstat (limited to 'include/godot_cpp')
-rw-r--r-- | include/godot_cpp/core/method_bind.hpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/godot_cpp/core/method_bind.hpp b/include/godot_cpp/core/method_bind.hpp index 1b51722..5247998 100644 --- a/include/godot_cpp/core/method_bind.hpp +++ b/include/godot_cpp/core/method_bind.hpp @@ -600,7 +600,11 @@ protected: virtual GDNativePropertyInfo gen_argument_type_info(int p_arg) const { GDNativePropertyInfo pi; - call_get_argument_type_info<P...>(p_arg, pi); + if (p_arg >= 0 && p_arg < (int)sizeof...(P)) { + call_get_argument_type_info<P...>(p_arg, pi); + } else { + pi = PropertyInfo(); + } return pi; } #if defined(__GNUC__) && !defined(__clang__) |