summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2015-01-10 21:15:03 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2015-01-10 21:15:03 +0100
commit825049026dd2b2e906cdb46279faa39580d931d1 (patch)
tree408c911fb0ac5d9893829e2616c35a02002f9058
parent8edf958a8ddf6c13b8bba9b87f3d5b1296be1376 (diff)
exception support for the Script class
-rw-r--r--zend/script.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/zend/script.cpp b/zend/script.cpp
index 6cebaeb..46a9ddd 100644
--- a/zend/script.cpp
+++ b/zend/script.cpp
@@ -172,8 +172,15 @@ Value Script::execute() const
// destination for the long jump, so that we can catch a failure
zend_try
{
+ // the current exception
+ zval* oldException = EG(exception);
+
// execute the code
zend_execute(_opcodes TSRMLS_CC);
+
+ // was an exception thrown inside the eval()'ed code? In that case we
+ // throw a C++ new exception to give the C++ code the chance to catch it
+ if (oldException != EG(exception) && EG(exception)) throw OrigException(EG(exception) TSRMLS_CC);
}
zend_catch
{