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 2b34bd0d8b)
pull/1527/head
Yuri Sizov 2024-06-27 18:40:29 +02:00 committed by David Snopek
parent 18c31e3e31
commit 80aec184df
1 changed files with 1 additions and 1 deletions

View File

@ -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;