From f91c4db49dbd00d75c4e8646f08409722bcebffc Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Fri, 3 May 2024 20:36:07 +0800 Subject: [PATCH] some fix --- include/pocketpy/vm.h | 2 +- src/ceval.cpp | 2 +- src/vm.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/pocketpy/vm.h b/include/pocketpy/vm.h index cf93b445..b6f9e38d 100644 --- a/include/pocketpy/vm.h +++ b/include/pocketpy/vm.h @@ -441,7 +441,7 @@ public: /***** Private *****/ void __breakpoint(); - PyObject* __format_string(Str, PyObject*); + PyObject* __format_object(PyObject*, Str); PyObject* __run_top_frame(); void __pop_frame(); PyObject* __py_generator(Frame&& frame, ArgsView buffer); diff --git a/src/ceval.cpp b/src/ceval.cpp index d1945e3e..239eda44 100644 --- a/src/ceval.cpp +++ b/src/ceval.cpp @@ -945,7 +945,7 @@ __NEXT_STEP:; case OP_FORMAT_STRING: { PyObject* _0 = POPX(); const Str& spec = CAST(Str&, co->consts[byte.arg]); - PUSH(__format_string(spec, _0)); + PUSH(__format_object(_0, spec)); } DISPATCH(); /*****************************************/ case OP_INC_FAST:{ diff --git a/src/vm.cpp b/src/vm.cpp index ef885565..af180780 100644 --- a/src/vm.cpp +++ b/src/vm.cpp @@ -499,7 +499,7 @@ i64 VM::py_hash(PyObject* obj){ } } -PyObject* VM::__format_string(Str spec, PyObject* obj){ +PyObject* VM::__format_object(PyObject* obj, Str spec){ if(spec.empty()) return py_str(obj); char type; switch(spec.end()[-1]){