Skip to content

Commit 794dea0

Browse files
authored
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
2 parents d8a65ed + d894f48 commit 794dea0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/godot_cpp/core/method_bind.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,11 @@ class MethodBindTS : public MethodBind {
600600

601601
virtual GDNativePropertyInfo gen_argument_type_info(int p_arg) const {
602602
GDNativePropertyInfo pi;
603-
call_get_argument_type_info<P...>(p_arg, pi);
603+
if (p_arg >= 0 && p_arg < (int)sizeof...(P)) {
604+
call_get_argument_type_info<P...>(p_arg, pi);
605+
} else {
606+
pi = PropertyInfo();
607+
}
604608
return pi;
605609
}
606610
#if defined(__GNUC__) && !defined(__clang__)

0 commit comments

Comments
 (0)