]> granicus.if.org Git - php/commitdiff
Fix IS_UNDEF comparisons in opcache
authorSébastien Santoro <dereckson@espace-win.org>
Wed, 21 Dec 2016 21:14:04 +0000 (21:14 +0000)
committerNikita Popov <nikic@php.net>
Thu, 22 Dec 2016 11:46:14 +0000 (12:46 +0100)
These conditions were formerly `!q->pData` and `!p->pData`, and should
now be detected as undefined variables, using the special type IS_UNDEF.

Incidentally, this syntax raised a logical-not-parentheses compiler
warning, now gone.

ext/opcache/ZendAccelerator.c

index 8844da6d591d3e13bf5ce01ef710a919d5628a10..676e3939a8a0262745ba286cd4b9d3dabc810c7f 100644 (file)
@@ -582,7 +582,7 @@ static void accel_use_shm_interned_strings(void)
 
                for (j = 0; j < ce->constants_table.nNumUsed; j++) {
                        q = ce->constants_table.arData + j;
-                       if (!Z_TYPE(q->val) == IS_UNDEF) continue;
+                       if (Z_TYPE(q->val) == IS_UNDEF) continue;
                        if (q->key) {
                                q->key = accel_new_interned_string(q->key);
                        }
@@ -592,7 +592,7 @@ static void accel_use_shm_interned_strings(void)
        /* constant hash keys */
        for (idx = 0; idx < EG(zend_constants)->nNumUsed; idx++) {
                p = EG(zend_constants)->arData + idx;
-               if (!Z_TYPE(p->val) == IS_UNDEF) continue;
+               if (Z_TYPE(p->val) == IS_UNDEF) continue;
                if (p->key) {
                        p->key = accel_new_interned_string(p->key);
                }