diff options
Diffstat (limited to 'sapi')
-rw-r--r-- | sapi/cli/php_cli.c | 8 | ||||
-rw-r--r-- | sapi/phpdbg/phpdbg_prompt.c | 12 |
2 files changed, 9 insertions, 11 deletions
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 845312e9c6..4874e0920c 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -1067,12 +1067,10 @@ static int do_cli(int argc, char **argv) /* {{{ */ pce->constructor, Z_OBJ(ref), NULL, &arg); if (EG(exception)) { - zval tmp, *msg, rv; - - ZVAL_OBJ(&tmp, EG(exception)); - msg = zend_read_property(zend_ce_exception, &tmp, "message", sizeof("message")-1, 0, &rv); + zval rv; + zval *msg = zend_read_property(zend_ce_exception, EG(exception), "message", sizeof("message")-1, 0, &rv); zend_printf("Exception: %s\n", Z_STRVAL_P(msg)); - zval_ptr_dtor(&tmp); + zend_object_release(EG(exception)); EG(exception) = NULL; } else { zend_print_zval(&ref, 0); diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c index 9977adad4c..7647859222 100644 --- a/sapi/phpdbg/phpdbg_prompt.c +++ b/sapi/phpdbg/phpdbg_prompt.c @@ -726,8 +726,8 @@ static inline void phpdbg_handle_exception(void) /* {{{ */ ZVAL_OBJ(&zv, ex); zend_call_known_instance_method_with_0_params(ex->ce->__tostring, ex, &tmp); - file = zval_get_string(zend_read_property(zend_get_exception_base(&zv), &zv, ZEND_STRL("file"), 1, &rv)); - line = zval_get_long(zend_read_property(zend_get_exception_base(&zv), &zv, ZEND_STRL("line"), 1, &rv)); + file = zval_get_string(zend_read_property(zend_get_exception_base(&zv), Z_OBJ(zv), ZEND_STRL("file"), 1, &rv)); + line = zval_get_long(zend_read_property(zend_get_exception_base(&zv), Z_OBJ(zv), ZEND_STRL("line"), 1, &rv)); if (EG(exception)) { EG(exception) = NULL; @@ -735,7 +735,7 @@ static inline void phpdbg_handle_exception(void) /* {{{ */ } else { zend_update_property_string(zend_get_exception_base(&zv), &zv, ZEND_STRL("string"), Z_STRVAL(tmp)); zval_ptr_dtor(&tmp); - msg = zval_get_string(zend_read_property(zend_get_exception_base(&zv), &zv, ZEND_STRL("string"), 1, &rv)); + msg = zval_get_string(zend_read_property(zend_get_exception_base(&zv), Z_OBJ(zv), ZEND_STRL("string"), 1, &rv)); } phpdbg_error("exception", "name=\"%s\" file=\"%s\" line=\"" ZEND_LONG_FMT "\"", "Uncaught %s in %s on line " ZEND_LONG_FMT, ZSTR_VAL(ex->ce->name), ZSTR_VAL(file), line); @@ -1740,9 +1740,9 @@ void phpdbg_execute_ex(zend_execute_data *execute_data) /* {{{ */ PHPDBG_G(handled_exception) = exception; ZVAL_OBJ(&zv, exception); - file = zval_get_string(zend_read_property(zend_get_exception_base(&zv), &zv, ZEND_STRL("file"), 1, &rv)); - line = zval_get_long(zend_read_property(zend_get_exception_base(&zv), &zv, ZEND_STRL("line"), 1, &rv)); - msg = zval_get_string(zend_read_property(zend_get_exception_base(&zv), &zv, ZEND_STRL("message"), 1, &rv)); + file = zval_get_string(zend_read_property(zend_get_exception_base(&zv), Z_OBJ(zv), ZEND_STRL("file"), 1, &rv)); + line = zval_get_long(zend_read_property(zend_get_exception_base(&zv), Z_OBJ(zv), ZEND_STRL("line"), 1, &rv)); + msg = zval_get_string(zend_read_property(zend_get_exception_base(&zv), Z_OBJ(zv), ZEND_STRL("message"), 1, &rv)); phpdbg_error("exception", "name=\"%s\" file=\"%s\" line=\"" ZEND_LONG_FMT "\"", |