diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index 386a10575cf1d..d7c341198ffd2 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -6065,6 +6065,19 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par SET_STACK_REG(stack, EX_VAR_TO_NUM(opline->op1.var), ZREG_NONE); } + if (opline->opcode == ZEND_ROPE_INIT) { + /* clear stack slots used by rope */ + uint32_t var = EX_VAR_TO_NUM(opline->result.var); + uint32_t count = + ((opline->extended_value * sizeof(void*)) + (sizeof(zval)-1)) / sizeof(zval); + + do { + SET_STACK_TYPE(stack, var, IS_UNKNOWN, 1); + var++; + count--; + } while (count); + } + if (ssa_op) { zend_ssa_range tmp; diff --git a/ext/opcache/tests/jit/rope_001.phpt b/ext/opcache/tests/jit/rope_001.phpt new file mode 100644 index 0000000000000..e48a2e2faaf5a --- /dev/null +++ b/ext/opcache/tests/jit/rope_001.phpt @@ -0,0 +1,17 @@ +--TEST-- +JIT ROPE: 001 *_ROPE may types of temporary variables +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_update_protection=0 +opcache.jit_buffer_size=1M +--FILE-- + +--EXPECT-- +bool(false) +bool(false)