Bug #68888 [Opn->Nab]: Useless Code
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)