]> granicus.if.org Git - php/commitdiff
Fix leak in shift_right_function
authorNikita Popov <nikic@php.net>
Fri, 2 Dec 2016 16:03:05 +0000 (17:03 +0100)
committerNikita Popov <nikic@php.net>
Fri, 2 Dec 2016 16:03:05 +0000 (17:03 +0100)
Zend/zend_operators.c

index 96571da53edba09934c540c20843083c711d8b75..aa2aaf1ab1df241d3f7ff6f2c24a49f358fc1039 100644 (file)
@@ -1586,10 +1586,10 @@ ZEND_API int ZEND_FASTCALL shift_right_function(zval *result, zval *op1, zval *o
        /* prevent wrapping quirkiness on some processors where >> 64 + x == >> x */
        if (UNEXPECTED((zend_ulong)op2_lval >= SIZEOF_ZEND_LONG * 8)) {
                if (EXPECTED(op2_lval > 0)) {
-                       ZVAL_LONG(result, (op1_lval < 0) ? -1 : 0);
                        if (op1 == result) {
                                zval_dtor(result);
                        }
+                       ZVAL_LONG(result, (op1_lval < 0) ? -1 : 0);
                        return SUCCESS;
                } else {
                        if (EG(current_execute_data) && !CG(in_compilation)) {