diff options
author | Dmitry Stogov <dmitry@php.net> | 2005-12-01 12:56:06 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2005-12-01 12:56:06 +0000 |
commit | e97817ef6412324818d23d3eae7ab8bcbe438ee8 (patch) | |
tree | cc8992ea327e3132a5685bf2a18286f577de2564 | |
parent | f49bc6b3c2e728cfcb7f8a498c58528cbff36315 (diff) | |
download | php-git-e97817ef6412324818d23d3eae7ab8bcbe438ee8.tar.gz |
Fixed bug #35437 (Segfault or Invalid Opcode 137/1/4)
-rw-r--r-- | NEWS | 1 | ||||
-rwxr-xr-x | Zend/tests/bug35437.phpt | 27 | ||||
-rw-r--r-- | Zend/zend_execute.c | 4 |
3 files changed, 32 insertions, 0 deletions
@@ -4,6 +4,7 @@ PHP NEWS - Fixed an error in mysqli_fetch_fields (returned NULL instead of an array when row number > field_count). (Georg) - Renamed CachingRecursiveIterator to RecursiveCachingIterator. (Marcus) +- Fixed bug #35437 (Segfault or Invalid Opcode 137/1/4). (Dmitry) - Fixed bug #35399 (Since fix of bug #35273 SOAP decoding of soapenc:base64binary fails). (Dmitry) - Fixed bug #35360 (exceptions in interactive mode (php -a) may cause crash). diff --git a/Zend/tests/bug35437.phpt b/Zend/tests/bug35437.phpt new file mode 100755 index 0000000000..eecdee9683 --- /dev/null +++ b/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 diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 24d630c9ec..fc0241ef69 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -1384,6 +1384,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; |