Browse Source

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

migration/RELEASE_1_0_0
Dmitry Stogov 21 years ago
parent
commit
a139e19fe3
  1. 27
      Zend/tests/bug35437.phpt
  2. 4
      Zend/zend_vm_execute.h
  3. 4
      Zend/zend_vm_execute.skl

27
Zend/tests/bug35437.phpt

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

4
Zend/zend_vm_execute.h

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

4
Zend/zend_vm_execute.skl

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

Loading…
Cancel
Save