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