php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68888 Useless Code
Submitted: 2015-01-22 14:37 UTC Modified: 2015-01-22 14:50 UTC
From: bugreports at internot dot info Assigned:
Status: Not a bug Package: *General Issues
PHP Version: master-Git-2015-01-22 (Git) OS: Linux Ubuntu 14.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bugreports at internot dot info
New email:
PHP Version: OS:

 

 [2015-01-22 14:37 UTC] 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,


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-01-22 14:50 UTC] nikic@php.net
-Status: Open +Status: Not a bug
 [2015-01-22 14:50 UTC] nikic@php.net
Nope, because of the (zend_ulong) cast. The condition effectively checks if op2_lval is negative OR greater than the maximum shift width.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 07:01:27 2024 UTC