mirror of
https://github.com/php/php-src.git
synced 2026-03-26 17:22:15 +01:00
Fixed bug #35437 (Segfault or Invalid Opcode 137/1/4)
This commit is contained in:
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;
|
||||
|
||||
|
||||
if (EG(exception)) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Initialize execute_data */
|
||||
EX(fbc) = NULL;
|
||||
EX(object) = NULL;
|
||||
|
||||
@@ -7,6 +7,10 @@ ZEND_API void {%EXECUTOR_NAME%}(zend_op_array *op_array TSRMLS_DC)
|
||||
|
||||
{%INTERNAL_LABELS%}
|
||||
|
||||
if (EG(exception)) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Initialize execute_data */
|
||||
EX(fbc) = NULL;
|
||||
EX(object) = NULL;
|
||||
|
||||
Reference in New Issue
Block a user