]> granicus.if.org Git - php/commitdiff
Remove redundant variable rv and optimize code
authorZiMuyang <yuanhualong666@gmail.com>
Sun, 27 Oct 2019 15:21:31 +0000 (23:21 +0800)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 28 Oct 2019 10:42:45 +0000 (11:42 +0100)
Closes GH-4864.

Zend/zend_exceptions.c

index ecd946a06ec0549086001ddf22b595bd7e3a83ab..8672ed8e003426b38f00ef91848113886b32a0e1 100644 (file)
@@ -979,7 +979,7 @@ ZEND_API ZEND_COLD void zend_exception_error(zend_object *ex, int severity) /* {
        zend_class_entry *ce_exception;
 
        ZVAL_OBJ(&exception, ex);
-       ce_exception = Z_OBJCE(exception);
+       ce_exception = ex->ce;
        EG(exception) = NULL;
        if (ce_exception == zend_ce_parse_error || ce_exception == zend_ce_compile_error) {
                zend_string *message = zval_get_string(GET_PROPERTY(&exception, ZEND_STR_MESSAGE));
@@ -992,7 +992,7 @@ ZEND_API ZEND_COLD void zend_exception_error(zend_object *ex, int severity) /* {
                zend_string_release_ex(file, 0);
                zend_string_release_ex(message, 0);
        } else if (instanceof_function(ce_exception, zend_ce_throwable)) {
-               zval tmp, rv;
+               zval tmp;
                zend_string *str, *file = NULL;
                zend_long line = 0;