summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuri Sizov <yuris@humnom.net>2024-06-27 18:40:29 +0200
committerYuri Sizov <yuris@humnom.net>2024-06-27 18:40:29 +0200
commit2b34bd0d8b16d471803660b2de0f258c0d6cfe7d (patch)
tree507e67d21fc68ff632bb3d68cc73991e387db210
parent53b546e1df6c732a6a59ddf0ded5eb4249664eb8 (diff)
downloadredot-cpp-2b34bd0d8b16d471803660b2de0f258c0d6cfe7d.tar.gz
Fix argument metadata when binding methods
While there doesn't seem to be any runtime issues, this triggers the address sanitizer in a few ways, depending on what kind of method you're binding.
-rw-r--r--include/godot_cpp/core/method_bind.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/godot_cpp/core/method_bind.hpp b/include/godot_cpp/core/method_bind.hpp
index eabd6ec..f2da66c 100644
--- a/include/godot_cpp/core/method_bind.hpp
+++ b/include/godot_cpp/core/method_bind.hpp
@@ -132,7 +132,7 @@ public:
std::vector<GDExtensionClassMethodArgumentMetadata> vec;
// First element is return value
vec.reserve(argument_count + 1);
- for (int i = 0; i < argument_count; i++) {
+ for (int i = 0; i < argument_count + 1; i++) {
vec.push_back(get_argument_metadata(i - 1));
}
return vec;