]> granicus.if.org Git - php/commitdiff
Don't check non-CVs for UNDEF in BOOL(_NOT)
authorNikita Popov <nikic@php.net>
Sun, 13 Dec 2015 23:32:40 +0000 (00:32 +0100)
committerNikita Popov <nikic@php.net>
Sun, 13 Dec 2015 23:32:40 +0000 (00:32 +0100)
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index 73b531225f02429f39ff5d366fe2a98780342087..7864054f9dc26cc17b0d3bfc2aed562cea54545d 100644 (file)
@@ -685,7 +685,7 @@ ZEND_VM_HANDLER(13, ZEND_BOOL_NOT, CONST|TMPVAR|CV, ANY)
                ZVAL_FALSE(EX_VAR(opline->result.var));
        } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
                ZVAL_TRUE(EX_VAR(opline->result.var));
-               if (UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
+               if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
                        SAVE_OPLINE();
                        GET_OP1_UNDEF_CV(val, BP_VAR_R);
                        ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -4900,7 +4900,7 @@ ZEND_VM_HANDLER(52, ZEND_BOOL, CONST|TMPVAR|CV, ANY)
                ZVAL_TRUE(EX_VAR(opline->result.var));
        } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
                ZVAL_FALSE(EX_VAR(opline->result.var));
-               if (UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
+               if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
                        SAVE_OPLINE();
                        GET_OP1_UNDEF_CV(val, BP_VAR_R);
                        ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
index 51bc0a0db18c8a1ee6ad462bacfa0f1408cb4616..8391544b2aaff1007c9e21559488ad286955bf9a 100644 (file)
@@ -2843,7 +2843,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_CONST_HANDLER(ZE
                ZVAL_FALSE(EX_VAR(opline->result.var));
        } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
                ZVAL_TRUE(EX_VAR(opline->result.var));
-               if (UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
+               if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
                        SAVE_OPLINE();
                        GET_OP1_UNDEF_CV(val, BP_VAR_R);
                        ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -3330,7 +3330,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_SPEC_CONST_HANDLER(ZEND_O
                ZVAL_TRUE(EX_VAR(opline->result.var));
        } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
                ZVAL_FALSE(EX_VAR(opline->result.var));
-               if (UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
+               if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
                        SAVE_OPLINE();
                        GET_OP1_UNDEF_CV(val, BP_VAR_R);
                        ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -28650,7 +28650,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_CV_HANDLER(ZEND_
                ZVAL_FALSE(EX_VAR(opline->result.var));
        } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
                ZVAL_TRUE(EX_VAR(opline->result.var));
-               if (UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
+               if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
                        SAVE_OPLINE();
                        GET_OP1_UNDEF_CV(val, BP_VAR_R);
                        ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -29430,7 +29430,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_SPEC_CV_HANDLER(ZEND_OPCO
                ZVAL_TRUE(EX_VAR(opline->result.var));
        } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
                ZVAL_FALSE(EX_VAR(opline->result.var));
-               if (UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
+               if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
                        SAVE_OPLINE();
                        GET_OP1_UNDEF_CV(val, BP_VAR_R);
                        ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -40722,7 +40722,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_TMPVAR_HANDLER(Z
                ZVAL_FALSE(EX_VAR(opline->result.var));
        } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
                ZVAL_TRUE(EX_VAR(opline->result.var));
-               if (UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
+               if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
                        SAVE_OPLINE();
                        GET_OP1_UNDEF_CV(val, BP_VAR_R);
                        ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -40989,7 +40989,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_SPEC_TMPVAR_HANDLER(ZEND_
                ZVAL_TRUE(EX_VAR(opline->result.var));
        } else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
                ZVAL_FALSE(EX_VAR(opline->result.var));
-               if (UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
+               if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(val) == IS_UNDEF)) {
                        SAVE_OPLINE();
                        GET_OP1_UNDEF_CV(val, BP_VAR_R);
                        ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();