From f67861b24ed2ec6d7fb0a8b63284da8c9397017b Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Mon, 27 Feb 2023 17:33:01 +0800 Subject: [PATCH] fix a bug --- src/ceval.h | 2 +- src/common.h | 3 +++ src/pocketpy.h | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ceval.h b/src/ceval.h index 1b1a3e49..75bf82c0 100644 --- a/src/ceval.h +++ b/src/ceval.h @@ -55,7 +55,7 @@ PyVar VM::run_frame(Frame* frame){ if(byte.op == OP_FAST_INDEX) frame->push(ref.get(this, frame)); else frame->push(PyRef(ref)); } continue; - case OP_ROT_TWO: std::swap(frame->top(), frame->top_1()); continue; + case OP_ROT_TWO: ::std::swap(frame->top(), frame->top_1()); continue; case OP_STORE_REF: { // PyVar obj = frame->pop_value(this); // PyVarRef r = frame->pop(); diff --git a/src/common.h b/src/common.h index e0fd8afe..d5c2547b 100644 --- a/src/common.h +++ b/src/common.h @@ -26,6 +26,7 @@ #include #include #include +#include #define PK_VERSION "0.9.1" @@ -43,6 +44,8 @@ typedef double f64; namespace pkpy{ +namespace std = ::std; + struct Dummy { }; struct DummyInstance { }; struct DummyModule { }; diff --git a/src/pocketpy.h b/src/pocketpy.h index b5e58afd..3fd0d34d 100644 --- a/src/pocketpy.h +++ b/src/pocketpy.h @@ -615,7 +615,6 @@ void add_module_dis(VM* vm){ }); } -#include struct FileIO { PY_CLASS(io, FileIO)