summaryrefslogtreecommitdiffstats
path: root/include/godot_cpp/core/method_bind.hpp
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2022-07-03 21:11:35 +0200
committerGitHub <noreply@github.com>2022-07-03 21:11:35 +0200
commit794dea0dd75ed6e914a5d774d728c2eb670656cc (patch)
treed050ce3ef11709974583df6ba8ec666ce98865bc /include/godot_cpp/core/method_bind.hpp
parentd8a65edc4a681433fc3c2f0a19dee783ca6015df (diff)
parentd894f48f25f745ae5db54a3afdb240a99df4bae7 (diff)
downloadredot-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/core/method_bind.hpp')
-rw-r--r--include/godot_cpp/core/method_bind.hpp6
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__)