mirror of
https://github.com/php/php-src.git
synced 2024-11-25 02:44:58 +08:00
Ensure proper exception handling and EX(opline) state in USER_OPCODE handler
This commit is contained in:
parent
0fd7acd11d
commit
808f62bb4d
@ -7176,10 +7176,14 @@ ZEND_VM_HANDLER(150, ZEND_USER_OPCODE, ANY, ANY)
|
||||
|
||||
SAVE_OPLINE();
|
||||
ret = zend_user_opcode_handlers[opline->opcode](execute_data);
|
||||
LOAD_OPLINE();
|
||||
|
||||
if (EG(exception)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
switch (ret) {
|
||||
case ZEND_USER_OPCODE_CONTINUE:
|
||||
LOAD_OPLINE();
|
||||
ZEND_VM_CONTINUE();
|
||||
case ZEND_USER_OPCODE_RETURN:
|
||||
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
|
||||
@ -7194,8 +7198,10 @@ ZEND_VM_HANDLER(150, ZEND_USER_OPCODE, ANY, ANY)
|
||||
case ZEND_USER_OPCODE_LEAVE:
|
||||
ZEND_VM_LEAVE();
|
||||
case ZEND_USER_OPCODE_DISPATCH:
|
||||
ZEND_ASSERT(EX(opline) == opline);
|
||||
ZEND_VM_DISPATCH(opline->opcode, opline);
|
||||
default:
|
||||
ZEND_ASSERT(EX(opline) == opline);
|
||||
ZEND_VM_DISPATCH((zend_uchar)(ret & 0xff), opline);
|
||||
}
|
||||
}
|
||||
|
@ -1563,10 +1563,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_
|
||||
|
||||
SAVE_OPLINE();
|
||||
ret = zend_user_opcode_handlers[opline->opcode](execute_data);
|
||||
LOAD_OPLINE();
|
||||
|
||||
if (EG(exception)) {
|
||||
HANDLE_EXCEPTION();
|
||||
}
|
||||
|
||||
switch (ret) {
|
||||
case ZEND_USER_OPCODE_CONTINUE:
|
||||
LOAD_OPLINE();
|
||||
ZEND_VM_CONTINUE();
|
||||
case ZEND_USER_OPCODE_RETURN:
|
||||
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
|
||||
@ -1581,8 +1585,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_
|
||||
case ZEND_USER_OPCODE_LEAVE:
|
||||
ZEND_VM_LEAVE();
|
||||
case ZEND_USER_OPCODE_DISPATCH:
|
||||
ZEND_ASSERT(EX(opline) == opline);
|
||||
ZEND_VM_DISPATCH(opline->opcode, opline);
|
||||
default:
|
||||
ZEND_ASSERT(EX(opline) == opline);
|
||||
ZEND_VM_DISPATCH((zend_uchar)(ret & 0xff), opline);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user