From 80aec184df58c22827f3d8dc9af458fca155b5a5 Mon Sep 17 00:00:00 2001 From: Yuri Sizov Date: Thu, 27 Jun 2024 18:40:29 +0200 Subject: [PATCH] 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. (cherry picked from commit 2b34bd0d8b16d471803660b2de0f258c0d6cfe7d) --- include/godot_cpp/core/method_bind.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 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;