com php-src: Fixed crash: ext/opcache/jit/zend_jit.c
| From: | Dmitry Stogov | Date: | Wed, 03 Apr 2019 19:46:49 +0000 |
| Subject: | com php-src: Fixed crash: ext/opcache/jit/zend_jit.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-105515@lists.php.net to get a copy of this message | ||
Commit: 34d5c1b16fc0499548806b97e3d4c49a2756406a
Author: Dmitry Stogov <dmitry@zend.com> Wed, 3 Apr 2019 22:46:49 +0300
Parents: fc28e9a0b3b8752898a4538721a58e366836630f
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=34d5c1b16fc0499548806b97e3d4c49a2756406a
Log:
Fixed crash
Changed paths:
M ext/opcache/jit/zend_jit.c
Diff:
diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c
index 5a8a014..fffab89 100644
--- a/ext/opcache/jit/zend_jit.c
+++ b/ext/opcache/jit/zend_jit.c
@@ -2097,11 +2097,11 @@ static int zend_jit(zend_op_array *op_array, zend_ssa *ssa, const zend_op
*rt_op
zend_jit_label(&dasm_state, b);
if (zend_jit_level < ZEND_JIT_LEVEL_INLINE) {
- opline = op_array->opcodes + (ssa->cfg.blocks[b].start - 1);
if ((ssa->cfg.blocks[b].flags & ZEND_BB_FOLLOW)
- && (opline->opcode == ZEND_NOP
- || opline->opcode == ZEND_SWITCH_LONG
- || opline->opcode == ZEND_SWITCH_STRING)) {
+ && ssa->cfg.blocks[b].start != 0
+ && (op_array->opcodes[ssa->cfg.blocks[b].start - 1].opcode == ZEND_NOP
+ || op_array->opcodes[ssa->cfg.blocks[b].start - 1].opcode == ZEND_SWITCH_LONG
+ || op_array->opcodes[ssa->cfg.blocks[b].start - 1].opcode == ZEND_SWITCH_STRING)) {
if (!zend_jit_reset_opline(&dasm_state, op_array->opcodes + ssa->cfg.blocks[b].start)
|| !zend_jit_set_valid_ip(&dasm_state, op_array->opcodes +
ssa->cfg.blocks[b].start)) {
goto jit_failure;