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.
pull/1509/head
Yuri Sizov 2024-06-27 18:40:29 +02:00
parent 53b546e1df
commit 2b34bd0d8b
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;