#15630 [Opn->Csd]: imap_utf7_decode appears to be broken

From: Date: Mon, 09 Sep 2002 22:33:54 +0000
Subject: #15630 [Opn->Csd]: imap_utf7_decode appears to be broken
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-18870@lists.php.net to get a copy of this message
ID: 15630 Updated by: sniper@php.net Reported By: robert.marchand@umontreal.ca -Status: Open +Status: Closed Bug Type: IMAP related Operating System: SGI Irix 6.5 PHP Version: 4.2.2 New Comment: fixed -> closed. Previous Comments: ------------------------------------------------------------------------ [2002-09-09 16:00:27] kalowsky@php.net re-applied patch for SGI. ------------------------------------------------------------------------ [2002-09-09 15:22:47] robert.marchand@umontreal.ca Hi, the fix for the SGI compiler has not made it in 4.2.3. According to the cvs repository, php_imap.c 1.112.2.3 has it but not the version 1.112.2.4. Bye. ------------------------------------------------------------------------ [2002-09-05 15:50:46] gamid@isayev.net Are you going to fix this bug in PHP 4.2.3? ------------------------------------------------------------------------ [2002-08-14 16:56:31] kalowsky@php.net I've commited the SGI compiler patch to the CVS head. I have yet to see any real conclusion though on the utf7_decode() issue, and I really would not prefer to break BC. If there is some kind of agreement upon all whom this bug effects I'm open to it. ------------------------------------------------------------------------ [2002-08-14 16:16:26] spc@sgi.com The patch added by Robert Marchand corrects a deficiency in the original code. The statement *outp++ |= outp[1] >> 2; in the ext/imap/php_imap.c file is clearly non-standard C. This means that the result is *compiler*-dependent, and no compiler can be considered "wrong". The C standard says that the order in which operands of an assignment operator are evaluated is undefined. In other words, it is equally correct for a compiler to produce code equivalent to temp = outp[1] >> 2; *outp++ |= temp; or to produce code equivalent to temp = outp; outp++; *temp |= outp[1] >> 2; Since these are not equivalent bits of code, the *source code* is wrong, not the compiler. Robert's patch suggested on 13 August corrects this non-standard source code. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/15630 -- Edit this bug report at http://bugs.php.net/?id=15630&edit=1

« previous php.bugs (#18870) next »