This commit is contained in:
blueloveTH 2024-05-03 19:53:55 +08:00
parent beec29d0c3
commit 8795d2c06d
3 changed files with 6 additions and 6 deletions

View File

@ -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);

View File

@ -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: {

View File

@ -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){