Skip to content

Commit 9b854eb

Browse files
committed
More accurate handling of isset() and unset()
1 parent 79071fe commit 9b854eb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ext/opcache/Optimizer/zend_cfg.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,12 @@ int zend_build_cfg(zend_arena **arena, const zend_op_array *op_array, uint32_t b
366366
break;
367367
case ZEND_UNSET_VAR:
368368
case ZEND_ISSET_ISEMPTY_VAR:
369-
if (!(opline->extended_value & ZEND_QUICK_SET)) {
369+
if (((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_LOCAL) &&
370+
!(opline->extended_value & ZEND_QUICK_SET)) {
371+
flags |= ZEND_FUNC_INDIRECT_VAR_ACCESS;
372+
} else if (((opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_GLOBAL ||
373+
(opline->extended_value & ZEND_FETCH_TYPE_MASK) == ZEND_FETCH_GLOBAL_LOCK) &&
374+
!op_array->function_name) {
370375
flags |= ZEND_FUNC_INDIRECT_VAR_ACCESS;
371376
}
372377
break;

0 commit comments

Comments
 (0)