diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2015-01-10 21:15:03 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2015-01-10 21:15:03 +0100 |
commit | 825049026dd2b2e906cdb46279faa39580d931d1 (patch) | |
tree | 408c911fb0ac5d9893829e2616c35a02002f9058 | |
parent | 8edf958a8ddf6c13b8bba9b87f3d5b1296be1376 (diff) |
exception support for the Script class
-rw-r--r-- | zend/script.cpp | 7 |
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 { |