]> granicus.if.org Git - php/commitdiff
Fix incorrect GC_NUM2ADDR usage
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 5 Mar 2018 15:29:46 +0000 (16:29 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 5 Mar 2018 15:29:46 +0000 (16:29 +0100)
Both first_unused and GC_MAX_UNCOMPRESSED are addresses, so we
should compare them directly.

Zend/zend_gc.c

index 89aedfd5c2d0e582bcaacdea5600288ce8364051..662f9b01f7c84ef7cbac6636749406c7662cac1f 100644 (file)
@@ -609,7 +609,7 @@ ZEND_API void ZEND_FASTCALL gc_remove_from_buffer(zend_refcounted *ref)
        GC_REF_SET_INFO(ref, 0);
 
        /* Perform decopression only in case of large buffers */
-       if (UNEXPECTED(GC_G(first_unused) >= GC_NUM2ADDR(GC_MAX_UNCOMPRESSED))) {
+       if (UNEXPECTED(GC_G(first_unused) >= GC_MAX_UNCOMPRESSED)) {
                gc_remove_compressed(ref, addr);
                return;
        }