diff options
| author | Bob Weinand <bobwei9@hotmail.com> | 2015-08-11 22:36:47 +0200 |
|---|---|---|
| committer | Bob Weinand <bobwei9@hotmail.com> | 2015-08-11 22:36:47 +0200 |
| commit | 7c003948c618adb2a6691f529057388f02202f09 (patch) | |
| tree | c7d4c3ce4c90487dad819c38d514a4aa8ae92393 /Zend/zend_vm_def.h | |
| parent | dbd8edbbd08fbb2906ee9b540348b340715b5dbe (diff) | |
| download | php-git-7c003948c618adb2a6691f529057388f02202f09.tar.gz | |
Simplify ZEND_EXIT and count boolean values to it as exit status
Diffstat (limited to 'Zend/zend_vm_def.h')
| -rw-r--r-- | Zend/zend_vm_def.h | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index c968fd2907..9286f41ca7 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -6637,22 +6637,17 @@ ZEND_VM_HANDLER(79, ZEND_EXIT, CONST|TMPVAR|UNUSED|CV, ANY) SAVE_OPLINE(); if (OP1_TYPE != IS_UNUSED) { zend_free_op free_op1; - zval *ptr = GET_OP1_ZVAL_PTR(BP_VAR_R); - - do { - if (Z_TYPE_P(ptr) == IS_LONG) { - EG(exit_status) = Z_LVAL_P(ptr); - } else { - if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_ISREF_P(ptr)) { - ptr = Z_REFVAL_P(ptr); - if (Z_TYPE_P(ptr) == IS_LONG) { - EG(exit_status) = Z_LVAL_P(ptr); - break; - } - } - zend_print_variable(ptr); - } - } while (0); + zval *ptr = GET_OP1_ZVAL_PTR_DEREF(BP_VAR_R); + + if (Z_TYPE_P(ptr) == IS_LONG) { + EG(exit_status) = Z_LVAL_P(ptr); + } else if (Z_TYPE_P(ptr) == IS_TRUE || Z_TYPE_P(ptr) == IS_FALSE || Z_TYPE_P(ptr) == IS_NULL) { + EG(exit_status) = Z_TYPE_P(ptr) == IS_TRUE; + } else if (Z_TYPE_P(ptr) == IS_DOUBLE) { + EG(exit_status) = (int) Z_DVAL_P(ptr); + } else { + zend_print_variable(ptr); + } FREE_OP1(); } zend_bailout(); |
