mirror of
https://github.com/php/php-src.git
synced 2024-09-24 11:27:28 +00:00
Merge branch 'PHP-5.5'
This commit is contained in:
commit
e53e79c701
@ -1283,11 +1283,15 @@ static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array)
|
|||||||
|
|
||||||
/* adjust exception jump targets */
|
/* adjust exception jump targets */
|
||||||
if (op_array->last_try_catch) {
|
if (op_array->last_try_catch) {
|
||||||
int i;
|
int i, j;
|
||||||
for (i = 0; i< op_array->last_try_catch; i++) {
|
for (i = 0, j = 0; i< op_array->last_try_catch; i++) {
|
||||||
op_array->try_catch_array[i].try_op = cfg->try[i]->start_opline - new_opcodes;
|
if (cfg->try[i]->access) {
|
||||||
op_array->try_catch_array[i].catch_op = cfg->catch[i]->start_opline - new_opcodes;
|
op_array->try_catch_array[j].try_op = cfg->try[i]->start_opline - new_opcodes;
|
||||||
|
op_array->try_catch_array[j].catch_op = cfg->catch[i]->start_opline - new_opcodes;
|
||||||
|
j++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
op_array->last_try_catch = j;
|
||||||
efree(cfg->try);
|
efree(cfg->try);
|
||||||
efree(cfg->catch);
|
efree(cfg->catch);
|
||||||
}
|
}
|
||||||
|
118
ext/opcache/tests/bug65665.phpt
Normal file
118
ext/opcache/tests/bug65665.phpt
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
--TEST--
|
||||||
|
Bug #65665 (Exception not properly caught when opcache enabled)
|
||||||
|
--INI--
|
||||||
|
opcache.enable=1
|
||||||
|
opcache.enable_cli=1
|
||||||
|
--SKIPIF--
|
||||||
|
<?php require_once('skipif.inc'); ?>
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
function foo() {
|
||||||
|
try
|
||||||
|
{
|
||||||
|
switch (1)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception $e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
try
|
||||||
|
{
|
||||||
|
throw new Exception('aaa');
|
||||||
|
}
|
||||||
|
catch (Exception $e)
|
||||||
|
{
|
||||||
|
echo "correct\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception $e)
|
||||||
|
{
|
||||||
|
echo "wrong\n";
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
function foo1() {
|
||||||
|
try
|
||||||
|
{
|
||||||
|
switch (1)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception $e)
|
||||||
|
{
|
||||||
|
dummy:
|
||||||
|
echo "ect\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
try
|
||||||
|
{
|
||||||
|
throw new Exception('aaa');
|
||||||
|
}
|
||||||
|
catch (Exception $e)
|
||||||
|
{
|
||||||
|
echo "corr";
|
||||||
|
goto dummy;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception $e)
|
||||||
|
{
|
||||||
|
echo "wrong\n";
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
function foo2() {
|
||||||
|
try
|
||||||
|
{
|
||||||
|
switch (1)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
try
|
||||||
|
{
|
||||||
|
dummy:
|
||||||
|
throw new Exception('aaa');
|
||||||
|
}
|
||||||
|
catch (Exception $e)
|
||||||
|
{
|
||||||
|
echo "correct\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
goto dummy;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception $e)
|
||||||
|
{
|
||||||
|
echo "wrong\n";
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
foo();foo1();foo2();
|
||||||
|
--EXPECT--
|
||||||
|
correct
|
||||||
|
correct
|
||||||
|
correct
|
Loading…
Reference in New Issue
Block a user