Bug #68888 [Opn->Nab]: Useless Code

From: Date: Thu, 22 Jan 2015 14:50:55 +0000
Subject: Bug #68888 [Opn->Nab]: Useless Code
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190151@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68888&edit=1

 ID:                 68888
 Updated by:         nikic@php.net
 Reported by:        bugreports at internot dot info
 Summary:            Useless Code
-Status:             Open
+Status:             Not a bug
 Type:               Bug
 Package:            *General Issues
 Operating System:   Linux Ubuntu 14.04
 PHP Version:        master-Git-2015-01-22 (Git)
 Block user comment: N
 Private report:     N

 New Comment:

Nope, because of the (zend_ulong) cast. The condition effectively checks if op2_lval is negative OR
greater than the maximum shift width.


Previous Comments:
------------------------------------------------------------------------
[2015-01-22 14:37:19] bugreports at internot dot info

Description:
------------
Hi,

In Zend/zend_operators.c:


        if (UNEXPECTED((zend_ulong)op2_lval >= SIZEOF_ZEND_LONG * 8)) {
                if (EXPECTED(op2_lval > 0)) {
                        ZVAL_LONG(result, 0);
                        return SUCCESS;
                } else {

If "op2_lval >= SIZEOF_ZEND_LONG * 8" is true, then "op2_lval > 0" will
always be true, no?


Thanks,



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=68888&edit=1


Thread (2 messages)

« previous php.bugs (#190151) next »