Fixed bug #35437 (Segfault or Invalid Opcode 137/1/4)

This commit is contained in:
Dmitry Stogov 2005-12-01 12:51:19 +00:00
parent feaa2501d0
commit a139e19fe3
3 changed files with 35 additions and 0 deletions

27
Zend/tests/bug35437.phpt Executable file
View 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

View file

@ -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;

View file

@ -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;