]> granicus.if.org Git - php/commitdiff
Fixed bug #35437 (Segfault or Invalid Opcode 137/1/4)
authorDmitry Stogov <dmitry@php.net>
Thu, 1 Dec 2005 12:50:58 +0000 (12:50 +0000)
committerDmitry Stogov <dmitry@php.net>
Thu, 1 Dec 2005 12:50:58 +0000 (12:50 +0000)
NEWS
Zend/tests/bug35437.phpt [new file with mode: 0755]
Zend/zend_vm_execute.h
Zend/zend_vm_execute.skl

diff --git a/NEWS b/NEWS
index 7629acc6747e6a2eb8ee7dabf0a9e5499e0a5177..d1df4cfa6b952b9290e25b53bcb8fbed35f64da1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,7 @@ PHP                                                                        NEWS
   connecting to 5.x server. (Andrey)
 - Fixed bug #35496 (Crash in mcrypt_generic()/mdecrypt_generic() without 
   proper init). (Ilia)
+- Fixed bug #35437 (Segfault or Invalid Opcode 137/1/4). (Dmitry)
 - Fixed bug #34729 (Crash in ZTS mode under Apache). (Dmitry, Zeev) 
 - Fixed bug #35470 (Assigning global using variable name from array doesn't
   function). (Dmitry)
diff --git a/Zend/tests/bug35437.phpt b/Zend/tests/bug35437.phpt
new file mode 100755 (executable)
index 0000000..eecdee9
--- /dev/null
@@ -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
index d87382402a49e4ba0fa0667a348d6f92767bf413..8abcb9d59c87602b2998b4458240e93374e65e5a 100644 (file)
@@ -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;
index 6cfd1bbcd3057f3782efa2b64e42618a91d75bcc..9a3bd5038dcb67433e84f8671e1ee80243041686 100644 (file)
@@ -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;