com php-src: Fixed incorrect side exit opline of "fake" init_fcall guard: ext/opcache/jit/zend_jit_trace. c
| From: | Dmitry Stogov | Date: | Mon, 27 Jul 2020 20:27:07 +0000 |
| Subject: | com php-src: Fixed incorrect side exit opline of "fake" init_fcall guard: ext/opcache/jit/zend_jit_trace. c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-112394@lists.php.net to get a copy of this message | ||
Commit: 274131e4afaa2c2ac07350ef153ebf207baa7b0b
Author: Dmitry Stogov <dmitry@zend.com> Mon, 27 Jul 2020 23:27:07 +0300
Parents: eaeceb32932026c08a9d9e5be56da8e8111c5caa
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=274131e4afaa2c2ac07350ef153ebf207baa7b0b
Log:
Fixed incorrect side exit opline of "fake" init_fcall guard
Changed paths:
M ext/opcache/jit/zend_jit_trace.c
Diff:
diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c
index a55f04a82a..e558a48705 100644
--- a/ext/opcache/jit/zend_jit_trace.c
+++ b/ext/opcache/jit/zend_jit_trace.c
@@ -4433,6 +4433,7 @@ done:
SET_STACK_TYPE(stack, i, IS_UNKNOWN);
}
}
+ opline = NULL;
}
JIT_G(current_frame) = frame;
if (res_type != IS_UNKNOWN
@@ -4504,8 +4505,19 @@ done:
skip_guard = 1;
}
}
- if (!skip_guard && !zend_jit_init_fcall_guard(&dasm_state, NULL, p->func,
trace_buffer[1].opline)) {
- goto jit_failure;
+
+ if (!skip_guard) {
+ if (!opline) {
+ zend_jit_trace_rec *q = p + 1;
+ while (q->op != ZEND_JIT_TRACE_VM && q->op != ZEND_JIT_TRACE_END) {
+ q++;
+ }
+ opline = q->opline;
+ ZEND_ASSERT(opline != NULL);
+ }
+ if (!zend_jit_init_fcall_guard(&dasm_state, NULL, p->func, opline)) {
+ goto jit_failure;
+ }
}
}
}
@@ -4590,12 +4602,13 @@ done:
} else if (p->stop == ZEND_JIT_TRACE_STOP_LINK
|| p->stop == ZEND_JIT_TRACE_STOP_RETURN_HALT
|| p->stop == ZEND_JIT_TRACE_STOP_INTERPRETER) {
- if (opline->opcode == ZEND_DO_UCALL
- || opline->opcode == ZEND_DO_FCALL
- || opline->opcode == ZEND_DO_FCALL_BY_NAME
- || opline->opcode == ZEND_YIELD
- || opline->opcode == ZEND_YIELD_FROM
- || opline->opcode == ZEND_INCLUDE_OR_EVAL) {
+ if (opline
+ && (opline->opcode == ZEND_DO_UCALL
+ || opline->opcode == ZEND_DO_FCALL
+ || opline->opcode == ZEND_DO_FCALL_BY_NAME
+ || opline->opcode == ZEND_YIELD
+ || opline->opcode == ZEND_YIELD_FROM
+ || opline->opcode == ZEND_INCLUDE_OR_EVAL)) {
zend_jit_trace_setup_ret_counter(opline, jit_extension->offset);
}
if (JIT_G(current_frame)