Skip to content

Commit 64be98e

Browse files
committed
Update zend_vm_call_opcode_handler()
1 parent 41335c4 commit 64be98e

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

Zend/zend_vm_gen.php

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3011,11 +3011,26 @@ function gen_vm($def, $skel) {
30113011
out($f, "\t}\n");
30123012
out($f, "#else\n");
30133013
out($f, "\topline = ((opcode_handler_t)OPLINE->handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
3014-
out($f, "\tif (EXPECTED(opline != NULL)) {\n");
3015-
out($f, "\t\tret = EG(current_execute_data) != ex ? (int)(EG(current_execute_data)->prev_execute_data != ex) + 1 : 0;\n");
3016-
out($f, "\t\tSAVE_OPLINE();\n");
3014+
3015+
out($f, "# ifdef ZEND_HIGH_HALF_KERNEL\n");
3016+
out($f, "\tif (UNEXPECTED((intptr_t)opline <= 0)) {\n");
3017+
out($f, "# else\n");
3018+
out($f, "\tif (UNEXPECTED(((uintptr_t)opline & ZEND_VM_ENTER_BIT))) {\n");
3019+
out($f, "# endif\n");
3020+
out($f, "\t\topline = (const zend_op*)((uintptr_t)opline & ~ZEND_VM_ENTER_BIT);\n");
3021+
out($f, "\t\tif (EXPECTED(opline)) {\n");
3022+
out($f, "\t\t\t/* ZEND_VM_ENTER() or ZEND_VM_LEAVE() */\n");
3023+
out($f, "\t\t\tret = EG(current_execute_data) != ex ? (int)(EG(current_execute_data)->prev_execute_data != ex) + 1 : 0;\n");
3024+
out($f, "\t\t\texecute_data = EG(current_execute_data);\n");
3025+
out($f, "\t\t\tSAVE_OPLINE();\n");
3026+
out($f, "\t\t} else {\n");
3027+
out($f, "\t\t\t/* ZEND_VM_RETURN() */\n");
3028+
out($f, "\t\t\tret = -1;\n");
3029+
out($f, "\t\t}\n");
30173030
out($f, "\t} else {\n");
3018-
out($f, "\t\tret = -1;\n");
3031+
out($f, "\t\t/* ZEND_VM_CONTINUE() */\n");
3032+
out($f, "\t\tSAVE_OPLINE();\n");
3033+
out($f, "\t\tret = 0;\n");
30193034
out($f, "\t}\n");
30203035
out($f, "#endif\n");
30213036
out($f, "#ifdef ZEND_VM_FP_GLOBAL_REG\n");

0 commit comments

Comments
 (0)