mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Merge branch 'PHP-7.2'
* PHP-7.2: Fixed bug #76094 (Access violation when using opcache)
This commit is contained in:
commit
82e325ea91
@ -386,7 +386,8 @@ static zend_bool dce_instr(context *ctx, zend_op *opline, zend_ssa_op *ssa_op) {
|
|||||||
|
|
||||||
if ((opline->op1_type & (IS_VAR|IS_TMP_VAR))&& !is_var_dead(ctx, ssa_op->op1_use)) {
|
if ((opline->op1_type & (IS_VAR|IS_TMP_VAR))&& !is_var_dead(ctx, ssa_op->op1_use)) {
|
||||||
if (!try_remove_var_def(ctx, ssa_op->op1_use, ssa_op->op1_use_chain, opline)) {
|
if (!try_remove_var_def(ctx, ssa_op->op1_use, ssa_op->op1_use_chain, opline)) {
|
||||||
if (ssa->var_info[ssa_op->op1_use].type & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF)) {
|
if (ssa->var_info[ssa_op->op1_use].type & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF)
|
||||||
|
&& opline->opcode != ZEND_CASE) {
|
||||||
free_var = ssa_op->op1_use;
|
free_var = ssa_op->op1_use;
|
||||||
free_var_type = opline->op1_type;
|
free_var_type = opline->op1_type;
|
||||||
}
|
}
|
||||||
|
26
ext/opcache/tests/bug76094.phpt
Normal file
26
ext/opcache/tests/bug76094.phpt
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
--TEST--
|
||||||
|
Bug #76094 (Access violation when using opcache)
|
||||||
|
--INI--
|
||||||
|
opcache.enable=1
|
||||||
|
opcache.enable_cli=1
|
||||||
|
opcache.optimization_level=-1
|
||||||
|
--SKIPIF--
|
||||||
|
<?php require_once('skipif.inc'); ?>
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
function MetaType($t)
|
||||||
|
{
|
||||||
|
|
||||||
|
switch (strtoupper($t)) {
|
||||||
|
case PHP_INT_MAX :
|
||||||
|
return 1;
|
||||||
|
case 0:
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var_dump(MetaType("aa"));
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
int(0)
|
Loading…
Reference in New Issue
Block a user