mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-24 13:30:18 +00:00
Update vm.h
This commit is contained in:
parent
bc17e61463
commit
69f820acc6
11
src/vm.h
11
src/vm.h
@ -374,8 +374,8 @@ public:
|
||||
}
|
||||
|
||||
bool __isFrameValid(Frame* frame){
|
||||
for(const auto& f : callstack){
|
||||
if(f.get() == frame) return true;
|
||||
for(auto it=callstack.crbegin(); it!=callstack.crend(); ++it){
|
||||
if(it->get() == frame) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -687,7 +687,12 @@ public:
|
||||
__DEF_PY_POOL(Float, _Float, _tp_float, 256);
|
||||
__DEF_PY_AS_C(Float, _Float, _tp_float)
|
||||
__DEF_PY_POOL(Pointer, _Pointer, _tp_pointer, 256)
|
||||
__DEF_PY_AS_C(Pointer, _Pointer, _tp_pointer)
|
||||
|
||||
inline _Pointer& PyPointer_AS_C(const PyVar& obj)
|
||||
{
|
||||
if(!obj->isType(_tp_pointer)) typeError("expected an l-value");
|
||||
return std::get<_Pointer>(obj->_native);
|
||||
}
|
||||
|
||||
DEF_NATIVE(Str, _Str, _tp_str)
|
||||
DEF_NATIVE(List, PyVarList, _tp_list)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user