mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
Fixed bug #35437 (Segfault or Invalid Opcode 137/1/4)
This commit is contained in:
parent
feaa2501d0
commit
a139e19fe3
3 changed files with 35 additions and 0 deletions
27
Zend/tests/bug35437.phpt
Executable file
27
Zend/tests/bug35437.phpt
Executable file
|
@ -0,0 +1,27 @@
|
||||||
|
--TEST--
|
||||||
|
Bug #35437 Segfault or Invalid Opcode 137/1/4
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
function err2exception($errno, $errstr)
|
||||||
|
{
|
||||||
|
throw new Exception("Error occuried: " . $errstr);
|
||||||
|
}
|
||||||
|
|
||||||
|
set_error_handler('err2exception');
|
||||||
|
|
||||||
|
class TestClass
|
||||||
|
{
|
||||||
|
function testMethod()
|
||||||
|
{
|
||||||
|
$GLOBALS['t'] = new stdClass;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
TestClass::testMethod();
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo "Catched: ".$e->getMessage()."\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
Catched: Error occuried: Non-static method TestClass::testMethod() should not be called statically
|
|
@ -36,6 +36,10 @@ ZEND_API void execute(zend_op_array *op_array TSRMLS_DC)
|
||||||
zend_execute_data execute_data;
|
zend_execute_data execute_data;
|
||||||
|
|
||||||
|
|
||||||
|
if (EG(exception)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Initialize execute_data */
|
/* Initialize execute_data */
|
||||||
EX(fbc) = NULL;
|
EX(fbc) = NULL;
|
||||||
EX(object) = NULL;
|
EX(object) = NULL;
|
||||||
|
|
|
@ -7,6 +7,10 @@ ZEND_API void {%EXECUTOR_NAME%}(zend_op_array *op_array TSRMLS_DC)
|
||||||
|
|
||||||
{%INTERNAL_LABELS%}
|
{%INTERNAL_LABELS%}
|
||||||
|
|
||||||
|
if (EG(exception)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Initialize execute_data */
|
/* Initialize execute_data */
|
||||||
EX(fbc) = NULL;
|
EX(fbc) = NULL;
|
||||||
EX(object) = NULL;
|
EX(object) = NULL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue