mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-21 20:10:17 +00:00
some fix
This commit is contained in:
parent
beec29d0c3
commit
8795d2c06d
@ -166,7 +166,7 @@ public:
|
|||||||
VM(bool enable_os=true);
|
VM(bool enable_os=true);
|
||||||
|
|
||||||
void set_main_argv(int argc, char** argv);
|
void set_main_argv(int argc, char** argv);
|
||||||
|
|
||||||
void __breakpoint();
|
void __breakpoint();
|
||||||
void __pop_frame();
|
void __pop_frame();
|
||||||
|
|
||||||
@ -300,7 +300,7 @@ public:
|
|||||||
PyObject* __minmax_reduce(bool (VM::*op)(PyObject*, PyObject*), PyObject* args, PyObject* key);
|
PyObject* __minmax_reduce(bool (VM::*op)(PyObject*, PyObject*), PyObject* args, PyObject* key);
|
||||||
|
|
||||||
/***** Error Reporter *****/
|
/***** Error Reporter *****/
|
||||||
void __raise(bool re_raise=false);
|
void __raise_exc(bool re_raise=false);
|
||||||
|
|
||||||
void _builtin_error(StrName type);
|
void _builtin_error(StrName type);
|
||||||
void _builtin_error(StrName type, PyObject* arg);
|
void _builtin_error(StrName type, PyObject* arg);
|
||||||
|
@ -87,7 +87,7 @@ PyObject* VM::__run_top_frame(){
|
|||||||
|
|
||||||
while(true){
|
while(true){
|
||||||
try{
|
try{
|
||||||
if(need_raise){ need_raise = false; __raise(); }
|
if(need_raise){ need_raise = false; __raise_exc(); }
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
/* NOTE:
|
/* NOTE:
|
||||||
* Be aware of accidental gc!
|
* Be aware of accidental gc!
|
||||||
@ -939,7 +939,7 @@ __NEXT_STEP:;
|
|||||||
_builtin_error("AssertionError");
|
_builtin_error("AssertionError");
|
||||||
}
|
}
|
||||||
DISPATCH();
|
DISPATCH();
|
||||||
case OP_RE_RAISE: __raise(true); DISPATCH();
|
case OP_RE_RAISE: __raise_exc(true); DISPATCH();
|
||||||
case OP_POP_EXCEPTION: __last_exception = POPX(); DISPATCH();
|
case OP_POP_EXCEPTION: __last_exception = POPX(); DISPATCH();
|
||||||
/*****************************************/
|
/*****************************************/
|
||||||
case OP_FORMAT_STRING: {
|
case OP_FORMAT_STRING: {
|
||||||
|
@ -1294,10 +1294,10 @@ void VM::_error(PyObject* e_obj){
|
|||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
PUSH(e_obj);
|
PUSH(e_obj);
|
||||||
__raise();
|
__raise_exc();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VM::__raise(bool re_raise){
|
void VM::__raise_exc(bool re_raise){
|
||||||
Frame* frame = &callstack.top();
|
Frame* frame = &callstack.top();
|
||||||
Exception& e = PK_OBJ_GET(Exception, s_data.top());
|
Exception& e = PK_OBJ_GET(Exception, s_data.top());
|
||||||
if(!re_raise){
|
if(!re_raise){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user