]> granicus.if.org Git - php/commitdiff
Fix DIM_OBJ specialization in zend_vm_get_opcode_handler_func
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 7 Feb 2019 09:04:54 +0000 (10:04 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 7 Feb 2019 09:06:25 +0000 (10:06 +0100)
DIM_OBJ also specializes over ASSIGN_STATIC_PROP nowadays.

Zend/zend_vm_execute.h
Zend/zend_vm_gen.php

index d8258c9783fd837a872b0cb8fd80f188259cf693..89d958f659a3c3438b2a3f1f160c8e19eef428d4 100644 (file)
@@ -72891,8 +72891,8 @@ static const void* ZEND_FASTCALL zend_vm_get_opcode_handler_ex(uint32_t spec, co
                                offset += 1;
                        } else if (op->extended_value == ZEND_ASSIGN_OBJ) {
                                offset += 2;
-               } else if (op->extended_value == ZEND_ASSIGN_STATIC_PROP) {
-                       offset += 3;
+                       } else if (op->extended_value == ZEND_ASSIGN_STATIC_PROP) {
+                               offset += 3;
                        }
                } else if (spec & SPEC_RULE_ISSET) {
                        offset = offset * 2 + (op->extended_value & ZEND_ISEMPTY);
@@ -72946,11 +72946,13 @@ static const void *zend_vm_get_opcode_handler_func(zend_uchar opcode, const zend
                        }
                }
                else if (spec & SPEC_RULE_DIM_OBJ) {
-                       offset = offset * 3;
+                       offset = offset * 4;
                        if (op->extended_value == ZEND_ASSIGN_DIM) {
                                offset += 1;
                        } else if (op->extended_value == ZEND_ASSIGN_OBJ) {
                                offset += 2;
+                       } else if (op->extended_value == ZEND_ASSIGN_STATIC_PROP) {
+                               offset += 3;
                        }
                }
                else if (spec & SPEC_RULE_ISSET) offset = offset * 2 + (op->extended_value & ZEND_ISEMPTY);
index f847294112d5a42b95f11de1c189d1e97ecb789c..c7eaa522bbeb8f1aa27f9829c07af41c95e60ca2 100755 (executable)
@@ -2772,8 +2772,8 @@ function gen_vm($def, $skel) {
                                out($f, "\t\t\t\toffset += 1;\n");
                                out($f, "\t\t\t} else if (op->extended_value == ZEND_ASSIGN_OBJ) {\n");
                                out($f, "\t\t\t\toffset += 2;\n");
-                               out($f, "\t\t} else if (op->extended_value == ZEND_ASSIGN_STATIC_PROP) {\n");
-                               out($f, "\t\t\toffset += 3;\n");
+                               out($f, "\t\t\t} else if (op->extended_value == ZEND_ASSIGN_STATIC_PROP) {\n");
+                               out($f, "\t\t\t\toffset += 3;\n");
                                out($f, "\t\t\t}\n");
                                $else = "} else ";
                        }
@@ -2870,11 +2870,13 @@ function gen_vm($def, $skel) {
                                }
                                if (isset($used_extra_spec["DIM_OBJ"])) {
                                        out($f, "\t\t{$else}if (spec & SPEC_RULE_DIM_OBJ) {\n");
-                                       out($f, "\t\t\toffset = offset * 3;\n");
+                                       out($f, "\t\t\toffset = offset * 4;\n");
                                        out($f, "\t\t\tif (op->extended_value == ZEND_ASSIGN_DIM) {\n");
                                        out($f, "\t\t\t\toffset += 1;\n");
                                        out($f, "\t\t\t} else if (op->extended_value == ZEND_ASSIGN_OBJ) {\n");
                                        out($f, "\t\t\t\toffset += 2;\n");
+                                       out($f, "\t\t\t} else if (op->extended_value == ZEND_ASSIGN_STATIC_PROP) {\n");
+                                       out($f, "\t\t\t\toffset += 3;\n");
                                        out($f, "\t\t\t}\n");
                                        out($f, "\t\t}\n");
                                        $else = "else ";