summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2005-12-01 12:56:06 +0000
committerDmitry Stogov <dmitry@php.net>2005-12-01 12:56:06 +0000
commite97817ef6412324818d23d3eae7ab8bcbe438ee8 (patch)
treecc8992ea327e3132a5685bf2a18286f577de2564
parentf49bc6b3c2e728cfcb7f8a498c58528cbff36315 (diff)
downloadphp-git-e97817ef6412324818d23d3eae7ab8bcbe438ee8.tar.gz
Fixed bug #35437 (Segfault or Invalid Opcode 137/1/4)
-rw-r--r--NEWS1
-rwxr-xr-xZend/tests/bug35437.phpt27
-rw-r--r--Zend/zend_execute.c4
3 files changed, 32 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 10e085b78d..df79350c38 100644
--- a/NEWS
+++ b/NEWS
@@ -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;