Grokbase Groups PHP php-cvs May 2009
FAQ
iliaa Tue May 12 12:37:52 2009 UTC

Modified files:
/php-src/ext/standard/tests/strings bug38770.phpt
/php-src/ext/standard pack.c
Log:

MFB: Fixed bug #47564 (unpacking unsigned long 32bit bit endian returns
wrong result)


http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/bug38770.phpt?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/standard/tests/strings/bug38770.phpt
diff -u php-src/ext/standard/tests/strings/bug38770.phpt:1.3 php-src/ext/standard/tests/strings/bug38770.phpt:1.4
--- php-src/ext/standard/tests/strings/bug38770.phpt:1.3 Tue May 27 10:50:45 2008
+++ php-src/ext/standard/tests/strings/bug38770.phpt Tue May 12 12:37:52 2009
@@ -12,7 +12,7 @@
--EXPECT--
Array
(
- [1] => -30000
+ [1] => 4294937296
)
Array
(
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/pack.c?r1=1.73&r2=1.74&diff_format=u
Index: php-src/ext/standard/pack.c
diff -u php-src/ext/standard/pack.c:1.73 php-src/ext/standard/pack.c:1.74
--- php-src/ext/standard/pack.c:1.73 Tue Mar 10 23:39:40 2009
+++ php-src/ext/standard/pack.c Tue May 12 12:37:52 2009
@@ -15,7 +15,7 @@
Author: Chris Schneider <cschneid@relog.ch> |
+----------------------------------------------------------------------+
*/
-/* $Id: pack.c,v 1.73 2009/03/10 23:39:40 helly Exp $ */
+/* $Id: pack.c,v 1.74 2009/05/12 12:37:52 iliaa Exp $ */

#include "php.h"

@@ -777,6 +777,13 @@
}

v |= php_unpack(&input[inputpos], 4, issigned, map);
+ if (sizeof(long) > 4) {
+ if (type == 'l') {
+ v = (signed int) v;
+ } else {
+ v = (unsigned int) v;
+ }
+ }
add_rt_assoc_long(return_value, n, v);
break;
}

Search Discussions

  • Felipe Pena at May 18, 2009 at 12:43 pm
    Hello,
    Em Ter, 2009-05-12 às 12:37 +0000, Ilia Alshanetsky escreveu:
    iliaa Tue May 12 12:37:52 2009 UTC

    Modified files:
    /php-src/ext/standard/tests/strings bug38770.phpt
    /php-src/ext/standard pack.c
    Log:

    MFB: Fixed bug #47564 (unpacking unsigned long 32bit bit endian returns
    wrong result)


    http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/bug38770.phpt?r1=1.3&r2=1.4&diff_format=u
    Index: php-src/ext/standard/tests/strings/bug38770.phpt
    diff -u php-src/ext/standard/tests/strings/bug38770.phpt:1.3 php-src/ext/standard/tests/strings/bug38770.phpt:1.4
    --- php-src/ext/standard/tests/strings/bug38770.phpt:1.3 Tue May 27 10:50:45 2008
    +++ php-src/ext/standard/tests/strings/bug38770.phpt Tue May 12 12:37:52 2009
    @@ -12,7 +12,7 @@
    --EXPECT--
    Array
    (
    - [1] => -30000
    + [1] => 4294937296
    )
    This test is failing for me:
    003+ [1] => -30000
    003- [1] => 4294937296

    http://gcov.php.net/viewer.php?version=PHP_5_3&func=tests&file=ext%
    2Fstandard%2Ftests%2Fstrings%2Fbug38770.phpt

    --
    Regards,
    Felipe Pena
  • Hannes Magnusson at May 26, 2009 at 8:02 am
    This is still broken Ilia

    -Hannes

    On Tue, May 12, 2009 at 14:37, Ilia Alshanetsky wrote:
    iliaa           Tue May 12 12:37:52 2009 UTC

    Modified files:
    /php-src/ext/standard/tests/strings bug38770.phpt
    /php-src/ext/standard       pack.c
    Log:

    MFB: Fixed bug #47564 (unpacking unsigned long 32bit bit endian returns
    wrong result)


    http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/bug38770.phpt?r1=1.3&r2=1.4&diff_format=u
    Index: php-src/ext/standard/tests/strings/bug38770.phpt
    diff -u php-src/ext/standard/tests/strings/bug38770.phpt:1.3 php-src/ext/standard/tests/strings/bug38770.phpt:1.4
    --- php-src/ext/standard/tests/strings/bug38770.phpt:1.3        Tue May 27 10:50:45 2008
    +++ php-src/ext/standard/tests/strings/bug38770.phpt    Tue May 12 12:37:52 2009
    @@ -12,7 +12,7 @@
    --EXPECT--
    Array
    (
    -    [1] => -30000
    +    [1] => 4294937296
    )
    Array
    (
    http://cvs.php.net/viewvc.cgi/php-src/ext/standard/pack.c?r1=1.73&r2=1.74&diff_format=u
    Index: php-src/ext/standard/pack.c
    diff -u php-src/ext/standard/pack.c:1.73 php-src/ext/standard/pack.c:1.74
    --- php-src/ext/standard/pack.c:1.73    Tue Mar 10 23:39:40 2009
    +++ php-src/ext/standard/pack.c Tue May 12 12:37:52 2009
    @@ -15,7 +15,7 @@
    Author: Chris Schneider <cschneid@relog.ch>                          |
    +----------------------------------------------------------------------+
    */
    -/* $Id: pack.c,v 1.73 2009/03/10 23:39:40 helly Exp $ */
    +/* $Id: pack.c,v 1.74 2009/05/12 12:37:52 iliaa Exp $ */

    #include "php.h"

    @@ -777,6 +777,13 @@
    }

    v |= php_unpack(&input[inputpos], 4, issigned, map);
    +                                               if (sizeof(long) > 4) {
    +                                                       if (type == 'l') {
    +                                                               v = (signed int) v;
    +                                                       } else {
    +                                                               v = (unsigned int) v;
    +                                                       }
    +                                               }
    add_rt_assoc_long(return_value, n, v);
    break;
    }



    --
    PHP CVS Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-cvs @
categoriesphp
postedMay 12, '09 at 12:38p
activeMay 26, '09 at 8:02a
posts3
users3
websitephp.net

People

Translate

site design / logo © 2019 Grokbase