From 39fe442575ce917599f0b35cf5a2ce00aabb20a1 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Fri, 1 Mar 2024 18:32:59 +0800 Subject: [PATCH] fix a bug --- include/pocketpy/bindings.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/pocketpy/bindings.h b/include/pocketpy/bindings.h index 1cc1dac0..3ac31b04 100644 --- a/include/pocketpy/bindings.h +++ b/include/pocketpy/bindings.h @@ -170,13 +170,13 @@ void _bind(VM* vm, PyObject* obj, const char* sig, Ret(T::*func)(Params...)){ #define PY_POINTER_SETGETITEM(T) \ vm->bind__getitem__(PK_OBJ_GET(Type, type), [](VM* vm, PyObject* _0, PyObject* _1){ \ - VoidP& self = PK_OBJ_GET(VoidP&, _0); \ + VoidP& self = PK_OBJ_GET(VoidP, _0); \ i64 i = CAST(i64, _1); \ T* tgt = reinterpret_cast(self.ptr); \ return VAR(tgt[i]); \ }); \ vm->bind__setitem__(PK_OBJ_GET(Type, type), [](VM* vm, PyObject* _0, PyObject* _1, PyObject* _2){ \ - VoidP& self = PK_OBJ_GET(VoidP&, _0); \ + VoidP& self = PK_OBJ_GET(VoidP, _0); \ i64 i = CAST(i64, _1); \ T* tgt = reinterpret_cast(self.ptr); \ tgt[i] = CAST(T, _2); \