]> granicus.if.org Git - php/commitdiff
Fixed zend_vm_call_opcode_handler(). Make phpdbg work with HYBRID VM.
authorDmitry Stogov <dmitry@zend.com>
Thu, 4 May 2017 15:56:28 +0000 (18:56 +0300)
committerDmitry Stogov <dmitry@zend.com>
Thu, 4 May 2017 15:56:28 +0000 (18:56 +0300)
Zend/zend_vm_gen.php

index 4aaac77f8140e2ccc4e982042215588783b995b2..fd376ac5c2172617689e19e1d6215044cda52424 100644 (file)
@@ -2531,16 +2531,21 @@ function gen_vm($def, $skel) {
                out($f, "#endif\n");
                out($f, "\n");
                out($f, "\tLOAD_OPLINE();\n");
+               out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
                if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) {
                        out($f,"#if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)\n");
                        out($f, "\thandler = (opcode_handler_t)zend_get_real_opcode_handler(opline);\n");
                        out($f, "\thandler(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
-                       out($f,"#elif defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
-               } else {
-                       out($f,"#if defined(ZEND_VM_FP_GLOBAL_REG) && defined(ZEND_VM_IP_GLOBAL_REG)\n");
+                       out($f, "\tif (EXPECTED(opline != &hybrid_return_op)) {\n");
+                       out($f,"#else\n");
                }
                out($f, "\t((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
-               out($f, "\tif (EXPECTED(opline)) {\n");
+               if (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID) {
+                       out($f, "\tif (EXPECTED(opline)) {\n");
+                       out($f,"#endif\n");
+               } else {
+                       out($f, "\tif (EXPECTED(opline)) {\n");
+               }
                out($f, "\t\tret = execute_data != ex ? (int)(execute_data->prev_execute_data != ex) + 1 : 0;\n");
                out($f, "\t\tSAVE_OPLINE();\n");
                out($f, "\t} else {\n");