summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-11-17 08:35:54 +0100
committerGitHub <noreply@github.com>2021-11-17 08:35:54 +0100
commit3c04522ece1cedccdd1d5fff919a5d4e223bed50 (patch)
tree6445ea00ce887e747ca7bbb2d2bd85ffa7b226b9
parent7d1b454b679a0a10a38dc4dee150bb433ff4979d (diff)
parent035468669ae5a1587391f5b85bf3822715d6279b (diff)
Merge pull request #55039 from BastiaanOlij/fix_gdnative_array_index
Fix array access in gdextensions
-rw-r--r--core/extension/gdnative_interface.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/extension/gdnative_interface.cpp b/core/extension/gdnative_interface.cpp
index 4770c9c65f..a65408fdda 100644
--- a/core/extension/gdnative_interface.cpp
+++ b/core/extension/gdnative_interface.cpp
@@ -774,13 +774,13 @@ static GDNativeTypePtr gdnative_packed_vector3_array_operator_index_const(const
static GDNativeVariantPtr gdnative_array_operator_index(GDNativeTypePtr p_self, GDNativeInt p_index) {
Array *self = (Array *)p_self;
ERR_FAIL_INDEX_V(p_index, self->size(), nullptr);
- return (GDNativeTypePtr)&self[p_index];
+ return (GDNativeVariantPtr)&self->operator[](p_index);
}
static GDNativeVariantPtr gdnative_array_operator_index_const(const GDNativeTypePtr p_self, GDNativeInt p_index) {
const Array *self = (const Array *)p_self;
ERR_FAIL_INDEX_V(p_index, self->size(), nullptr);
- return (GDNativeTypePtr)&self[p_index];
+ return (GDNativeVariantPtr)&self->operator[](p_index);
}
/* OBJECT API */