From 30d968dea5eec9cc6eaf0d79948f5458e0d8c198 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Fri, 24 May 2024 23:33:54 +0800 Subject: [PATCH] Update frame.h --- include/pocketpy/frame.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/pocketpy/frame.h b/include/pocketpy/frame.h index 2b08904e..cdf7c1f2 100644 --- a/include/pocketpy/frame.h +++ b/include/pocketpy/frame.h @@ -47,8 +47,9 @@ struct ValueStack { PyVar& peek(int n){ return _sp[-n]; } PyVar peek(int n) const { return _sp[-n]; } void push(PyVar v){ *_sp++ = v; } + void push(std::nullptr_t) { memset(_sp++, 0, sizeof(PyVar)); } void pop(){ --_sp; } - PyVar popx(){ return *--_sp; } + PyVar popx(){ --_sp; return *_sp; } ArgsView view(int n){ return ArgsView(_sp-n, _sp); } void shrink(int n){ _sp -= n; } int size() const { return _sp - _begin; }