mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
Avoid useles copy ctor
This commit is contained in:
parent
54d9ad53f4
commit
e9f4d822b0
@ -2863,13 +2863,14 @@ ZEND_VM_HANDLER(108, ZEND_THROW, CONST|TMP|VAR|CV, ANY)
|
||||
}
|
||||
|
||||
zend_exception_save(TSRMLS_C);
|
||||
/* Not sure if a complete copy is what we want here */
|
||||
ZVAL_COPY_VALUE(&exception, value);
|
||||
if (!IS_OP1_TMP_FREE()) {
|
||||
zval_opt_copy_ctor(&exception);
|
||||
if (OP1_TYPE == IS_CONST) {
|
||||
ZVAL_DUP(&exception, value);
|
||||
value = &exception;
|
||||
} else if (OP1_TYPE != IS_TMP_VAR) {
|
||||
if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value);
|
||||
}
|
||||
|
||||
zend_throw_exception_object(&exception TSRMLS_CC);
|
||||
zend_throw_exception_object(value TSRMLS_CC);
|
||||
zend_exception_restore(TSRMLS_C);
|
||||
FREE_OP1_IF_VAR();
|
||||
HANDLE_EXCEPTION();
|
||||
|
@ -2638,13 +2638,14 @@ static int ZEND_FASTCALL ZEND_THROW_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
|
||||
}
|
||||
|
||||
zend_exception_save(TSRMLS_C);
|
||||
/* Not sure if a complete copy is what we want here */
|
||||
ZVAL_COPY_VALUE(&exception, value);
|
||||
if (!0) {
|
||||
zval_opt_copy_ctor(&exception);
|
||||
if (IS_CONST == IS_CONST) {
|
||||
ZVAL_DUP(&exception, value);
|
||||
value = &exception;
|
||||
} else if (IS_CONST != IS_TMP_VAR) {
|
||||
if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value);
|
||||
}
|
||||
|
||||
zend_throw_exception_object(&exception TSRMLS_CC);
|
||||
zend_throw_exception_object(value TSRMLS_CC);
|
||||
zend_exception_restore(TSRMLS_C);
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
@ -7585,13 +7586,14 @@ static int ZEND_FASTCALL ZEND_THROW_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
}
|
||||
|
||||
zend_exception_save(TSRMLS_C);
|
||||
/* Not sure if a complete copy is what we want here */
|
||||
ZVAL_COPY_VALUE(&exception, value);
|
||||
if (!1) {
|
||||
zval_opt_copy_ctor(&exception);
|
||||
if (IS_TMP_VAR == IS_CONST) {
|
||||
ZVAL_DUP(&exception, value);
|
||||
value = &exception;
|
||||
} else if (IS_TMP_VAR != IS_TMP_VAR) {
|
||||
if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value);
|
||||
}
|
||||
|
||||
zend_throw_exception_object(&exception TSRMLS_CC);
|
||||
zend_throw_exception_object(value TSRMLS_CC);
|
||||
zend_exception_restore(TSRMLS_C);
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
@ -12454,13 +12456,14 @@ static int ZEND_FASTCALL ZEND_THROW_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
}
|
||||
|
||||
zend_exception_save(TSRMLS_C);
|
||||
/* Not sure if a complete copy is what we want here */
|
||||
ZVAL_COPY_VALUE(&exception, value);
|
||||
if (!0) {
|
||||
zval_opt_copy_ctor(&exception);
|
||||
if (IS_VAR == IS_CONST) {
|
||||
ZVAL_DUP(&exception, value);
|
||||
value = &exception;
|
||||
} else if (IS_VAR != IS_TMP_VAR) {
|
||||
if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value);
|
||||
}
|
||||
|
||||
zend_throw_exception_object(&exception TSRMLS_CC);
|
||||
zend_throw_exception_object(value TSRMLS_CC);
|
||||
zend_exception_restore(TSRMLS_C);
|
||||
zval_ptr_dtor_nogc(free_op1.var);
|
||||
HANDLE_EXCEPTION();
|
||||
@ -28986,13 +28989,14 @@ static int ZEND_FASTCALL ZEND_THROW_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
}
|
||||
|
||||
zend_exception_save(TSRMLS_C);
|
||||
/* Not sure if a complete copy is what we want here */
|
||||
ZVAL_COPY_VALUE(&exception, value);
|
||||
if (!0) {
|
||||
zval_opt_copy_ctor(&exception);
|
||||
if (IS_CV == IS_CONST) {
|
||||
ZVAL_DUP(&exception, value);
|
||||
value = &exception;
|
||||
} else if (IS_CV != IS_TMP_VAR) {
|
||||
if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value);
|
||||
}
|
||||
|
||||
zend_throw_exception_object(&exception TSRMLS_CC);
|
||||
zend_throw_exception_object(value TSRMLS_CC);
|
||||
zend_exception_restore(TSRMLS_C);
|
||||
|
||||
HANDLE_EXCEPTION();
|
||||
|
Loading…
Reference in New Issue
Block a user