From 098dab470744ea3bb1d0620f8240fc5415a81174 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Fri, 24 May 2024 23:21:06 +0800 Subject: [PATCH] Revert "some fix" This reverts commit 1b2fae94ebff1aac5bc300eb512f620d0105fc94. --- include/pocketpy/vm.h | 6 ++---- src/ceval.cpp | 2 +- src/vm.cpp | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/pocketpy/vm.h b/include/pocketpy/vm.h index 4c29fce1..154416a9 100644 --- a/include/pocketpy/vm.h +++ b/include/pocketpy/vm.h @@ -287,16 +287,14 @@ public: template PyVar call(PyVar callable, Args&&... args){ - s_data.push(callable); - s_data.emplace(PY_NULL); + PUSH(callable); PUSH(PY_NULL); __push_varargs(args...); return vectorcall(sizeof...(args)); } template PyVar call_method(PyVar self, PyVar callable, Args&&... args){ - s_data.push(callable); - s_data.push(self); + PUSH(callable); PUSH(self); __push_varargs(args...); return vectorcall(sizeof...(args)); } diff --git a/src/ceval.cpp b/src/ceval.cpp index 952b3a5c..0a167874 100644 --- a/src/ceval.cpp +++ b/src/ceval.cpp @@ -173,7 +173,7 @@ __NEXT_STEP: } PUSH(obj); } DISPATCH() - case OP_LOAD_NULL: s_data.emplace(PY_NULL); DISPATCH() + case OP_LOAD_NULL: PUSH(PY_NULL); DISPATCH() /*****************************************/ case OP_LOAD_FAST: { PyVar _0 = frame->_locals[byte.arg]; diff --git a/src/vm.cpp b/src/vm.cpp index 1fcf1608..22e0e64a 100644 --- a/src/vm.cpp +++ b/src/vm.cpp @@ -1107,7 +1107,7 @@ PyVar VM::vectorcall(int ARGC, int KWARGC, bool op_call){ obj = vm->new_object(PK_OBJ_GET(Type, callable)); }else{ PUSH(new_f); - s_data.emplace(PY_NULL); + PUSH(PY_NULL); PUSH(callable); // cls for(PyVar o: args) PUSH(o); for(PyVar o: kwargs) PUSH(o);