From f4e9293643cb9da43a60da55439be15b7554b3ee Mon Sep 17 00:00:00 2001 From: szdytom Date: Thu, 13 Jun 2024 15:03:19 +0800 Subject: [PATCH] ... --- include/pocketpy/objects/dict.hpp | 2 +- include/pocketpy/objects/pyvar.h | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/include/pocketpy/objects/dict.hpp b/include/pocketpy/objects/dict.hpp index 8272a45c..1c51161c 100644 --- a/include/pocketpy/objects/dict.hpp +++ b/include/pocketpy/objects/dict.hpp @@ -34,7 +34,7 @@ struct Dict : private pkpy_Dict { PyVar try_get(VM* vm, PyVar key) const { auto res = pkpy_Dict__try_get(this, vm, *reinterpret_cast<::pkpy_Var*>(&key)); if (!res) return nullptr; - return *reinterpret_cast(&res); + return PyVar(*reinterpret_cast(&res)); } bool contains(VM* vm, PyVar key) const { diff --git a/include/pocketpy/objects/pyvar.h b/include/pocketpy/objects/pyvar.h index bc8fd593..5947c4d9 100644 --- a/include/pocketpy/objects/pyvar.h +++ b/include/pocketpy/objects/pyvar.h @@ -11,12 +11,8 @@ extern "C" { * @brief A python value in pocketpy. */ typedef struct { - // TODO: implement - - union { - int type; - char buf[16]; - }; + int type; + int _0, _1, _2; } pkpy_Var; /**