]> granicus.if.org Git - php/commitdiff
Fixed conditions
authorDmitry Stogov <dmitry@zend.com>
Mon, 14 May 2018 14:23:37 +0000 (17:23 +0300)
committerDmitry Stogov <dmitry@zend.com>
Mon, 14 May 2018 14:23:37 +0000 (17:23 +0300)
Zend/zend_vm_execute.h
Zend/zend_vm_gen.php

index 2101b04444753cc0e2863b7b660837897ced2980..56aadaca3ac0a5451d00b76e2e04c6c072d44ee2 100644 (file)
@@ -64250,7 +64250,7 @@ static const void* ZEND_FASTCALL zend_vm_get_opcode_handler_ex(uint32_t spec, co
        if (spec & SPEC_EXTRA_MASK) {
                if (spec & SPEC_RULE_OP_DATA) offset = offset * 5 + zend_vm_decode[(op + 1)->op1_type];
                else if (spec & SPEC_RULE_RETVAL) offset = offset * 2 + (op->result_type != IS_UNUSED);
-               else if (spec & SPEC_RULE_QUICK_ARG) offset = offset * 2 + (op->op2.num < MAX_ARG_FLAG_NUM);
+               else if (spec & SPEC_RULE_QUICK_ARG) offset = offset * 2 + (op->op2.num <= MAX_ARG_FLAG_NUM);
                else if (spec & SPEC_RULE_SMART_BRANCH) {
                        offset = offset * 3;
                        if ((op+1)->opcode == ZEND_JMPZ) {
@@ -64300,7 +64300,7 @@ static const void *zend_vm_get_opcode_handler_func(zend_uchar opcode, const zend
        if (spec & SPEC_EXTRA_MASK) {
                if (spec & SPEC_RULE_OP_DATA) offset = offset * 5 + zend_vm_decode[(op + 1)->op1_type];
                else if (spec & SPEC_RULE_RETVAL) offset = offset * 2 + (op->result_type != IS_UNUSED);
-               else if (spec & SPEC_RULE_QUICK_ARG) offset = offset * 2 + (op->op2.num < MAX_ARG_FLAG_NUM);
+               else if (spec & SPEC_RULE_QUICK_ARG) offset = offset * 2 + (op->op2.num <= MAX_ARG_FLAG_NUM);
                else if (spec & SPEC_RULE_SMART_BRANCH) {
                        offset = offset * 3;
                        if ((op+1)->opcode == ZEND_JMPZ) {
index 07c09afec29ddee4f77867a6fb725dfafc522e3c..0fef763c2b6b2ec1c9f14fa4a18082fa7ddfa458 100644 (file)
@@ -2611,7 +2611,7 @@ function gen_vm($def, $skel) {
                                $else = "else ";
                        }
                        if (isset($used_extra_spec["QUICK_ARG"])) {
-                               out($f, "\t\t{$else}if (spec & SPEC_RULE_QUICK_ARG) offset = offset * 2 + (op->op2.num < MAX_ARG_FLAG_NUM);\n");
+                               out($f, "\t\t{$else}if (spec & SPEC_RULE_QUICK_ARG) offset = offset * 2 + (op->op2.num <= MAX_ARG_FLAG_NUM);\n");
                                $else = "else ";
                        }
                        if (isset($used_extra_spec["SMART_BRANCH"])) {
@@ -2699,7 +2699,7 @@ function gen_vm($def, $skel) {
                                        $else = "else ";
                                }
                                if (isset($used_extra_spec["QUICK_ARG"])) {
-                                       out($f, "\t\t{$else}if (spec & SPEC_RULE_QUICK_ARG) offset = offset * 2 + (op->op2.num < MAX_ARG_FLAG_NUM);\n");
+                                       out($f, "\t\t{$else}if (spec & SPEC_RULE_QUICK_ARG) offset = offset * 2 + (op->op2.num <= MAX_ARG_FLAG_NUM);\n");
                                        $else = "else ";
                                }
                                if (isset($used_extra_spec["SMART_BRANCH"])) {