Bug #68146 [NEW]: Condition Grouping Review (zend_virtual_cwd.h)
| From: | pegasus at vaultwiki dot org | Date: | Fri, 03 Oct 2014 19:06:35 +0000 |
| Subject: | Bug #68146 [NEW]: Condition Grouping Review (zend_virtual_cwd.h) | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-187823@lists.php.net to get a copy of this message | ||
From: pegasus at vaultwiki dot org
Operating system:
PHP version: master-Git-2014-10-03 (Git)
Package: *General Issues
Bug Type: Bug
Bug description:Condition Grouping Review (zend_virtual_cwd.h)
Description:
------------
I was just reading through recent commits and saw this for
zend/zend_virtual_cwd.h (commit#
647ebe6bf214d1a30627bab1758b66262d2f780f)
- (len >= 2 && ((/* is local */isalpha(path[0]) && path[1] ==
':')
|| /* is UNC */IS_SLASH(path[0]) && IS_SLASH(path[1])))
+ (len >= 2 && (/* is local */isalpha(path[0]) && path[1] == ':'
|| /* is UNC */IS_SLASH(path[0]) && IS_SLASH(path[1])))
I could be forgetting my order of operations, but I think the lack of
grouping and similar operations causes LTR here... Shouldn't the proper
parenthetical grouping be:
(len >= 2 && ((/* is local */isalpha(path[0]) && path[1] == ':')
|| (/* is UNC */IS_SLASH(path[0]) && IS_SLASH(path[1]))))
Here it is tabulated for clarity:
(
len >= 2 &&
(
(
/* is local */
isalpha(path[0]) &&
path[1] == ':'
) ||
(
/* is UNC */
IS_SLASH(path[0]) &&
IS_SLASH(path[1])
)
)
)
--
Edit bug report at https://bugs.php.net/bug.php?id=68146&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68146&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68146&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68146&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=68146&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=68146&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=68146&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=68146&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=68146&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=68146&r=support
Expected behavior: https://bugs.php.net/fix.php?id=68146&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=68146&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=68146&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=68146&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68146&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=68146&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=68146&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=68146&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68146&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=68146&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=68146&r=mysqlcfg