com php-src: Fixed zend_vm_call_opcode_handler(). Make phpdbg work with HYBRID VM.: Zend/zend _vm_gen.php

[email protected] (Dmitry Stogov)
Newsgroups php.cvs
Message-ID <[email protected]>
Commit:    71bfb430af7df2d16ebf86a0ce62824982ccd27f
Author:    Dmitry Stogov <[email protected]>         Thu, 4 May 2017 18:56:28 +0300
Parents:   b5e857b905c63b1aed4c11e445152b326c9afe03
Branches:  master

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=71bfb430af7df2d16ebf86a0ce62824982ccd27f

Log:
Fixed zend_vm_call_opcode_handler(). Make phpdbg work with HYBRID VM.

Changed paths:
  M  Zend/zend_vm_gen.php


Diff:
diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php
index 4aaac77..fd376ac 100644
--- a/Zend/zend_vm_gen.php
+++ b/Zend/zend_vm_gen.php
@@ -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");
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.