[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/Zend/tests/bug60444.phpt branches/PHP_5_4/Zend/zend_compile.c trunk/Zend/tests/bug60444.phpt trunk/Zend/zend_compile.c

2011-12-05 Thread Dmitry Stogov
dmitry   Mon, 05 Dec 2011 09:20:12 +

Revision: http://svn.php.net/viewvc?view=revision&revision=320403

Log:
Fixed bug #60444 (Segmentation fault with include & class extending)

Bug: https://bugs.php.net/60444 (Assigned) Segmentation fault with include & 
class extending
  
Changed paths:
A   php/php-src/branches/PHP_5_4/Zend/tests/bug60444.phpt
U   php/php-src/branches/PHP_5_4/Zend/zend_compile.c
A   php/php-src/trunk/Zend/tests/bug60444.phpt
U   php/php-src/trunk/Zend/zend_compile.c

Added: php/php-src/branches/PHP_5_4/Zend/tests/bug60444.phpt
===
--- php/php-src/branches/PHP_5_4/Zend/tests/bug60444.phpt   
(rev 0)
+++ php/php-src/branches/PHP_5_4/Zend/tests/bug60444.phpt   2011-12-05 
09:20:12 UTC (rev 320403)
@@ -0,0 +1,18 @@
+--TEST--
+Bug #60444 (Segmentation fault with include & class extending)
+--FILE--
+parent) {
return;
@@ -2870,8 +2870,8 @@

if (zend_hash_find(&ce->parent->function_table, 
ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME), (void 
**)&function)==SUCCESS) {
/* inherit parent's constructor */
-   zend_hash_update(&ce->function_table, 
ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME), function, 
sizeof(zend_function), NULL);
-   function_add_ref(function);
+   zend_hash_update(&ce->function_table, 
ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME), function, 
sizeof(zend_function), (void**)&new_function);
+   function_add_ref(new_function);
} else {
/* Don't inherit the old style constructor if we already have 
the new style constructor */
char *lc_class_name;
@@ -2884,8 +2884,8 @@

zend_hash_find(&ce->parent->function_table, lc_parent_class_name, 
ce->parent->name_length+1, (void **)&function)==SUCCESS) {
if (function->common.fn_flags & ZEND_ACC_CTOR) {
/* inherit parent's constructor */
-   zend_hash_update(&ce->function_table, 
lc_parent_class_name, ce->parent->name_length+1, function, 
sizeof(zend_function), NULL);
-   function_add_ref(function);
+   zend_hash_update(&ce->function_table, 
lc_parent_class_name, ce->parent->name_length+1, function, 
sizeof(zend_function), (void**)new_function);
+   function_add_ref(new_function);
}
}
efree(lc_parent_class_name);

Added: php/php-src/trunk/Zend/tests/bug60444.phpt
===
--- php/php-src/trunk/Zend/tests/bug60444.phpt  (rev 0)
+++ php/php-src/trunk/Zend/tests/bug60444.phpt  2011-12-05 09:20:12 UTC (rev 
320403)
@@ -0,0 +1,18 @@
+--TEST--
+Bug #60444 (Segmentation fault with include & class extending)
+--FILE--
+parent) {
return;
@@ -2870,8 +2870,8 @@

if (zend_hash_find(&ce->parent->function_table, 
ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME), (void 
**)&function)==SUCCESS) {
/* inherit parent's constructor */
-   zend_hash_update(&ce->function_table, 
ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME), function, 
sizeof(zend_function), NULL);
-   function_add_ref(function);
+   zend_hash_update(&ce->function_table, 
ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME), function, 
sizeof(zend_function), (void**)&new_function);
+   function_add_ref(new_function);
} else {
/* Don't inherit the old style constructor if we already have 
the new style constructor */
char *lc_class_name;
@@ -2884,8 +2884,8 @@

zend_hash_find(&ce->parent->function_table, lc_parent_class_name, 
ce->parent->name_length+1, (void **)&function)==SUCCESS) {
if (function->common.fn_flags & ZEND_ACC_CTOR) {
/* inherit parent's constructor */
-   zend_hash_update(&ce->function_table, 
lc_parent_class_name, ce->parent->name_length+1, function, 
sizeof(zend_function), NULL);
-   function_add_ref(function);
+   zend_hash_update(&ce->function_table, 
lc_parent_class_name, ce->parent->name_length+1, function, 
sizeof(zend_function), (void**)new_function);
+   function_add_ref(new_function);
}
}
efree(lc_parent_class_name);

-- 
PHP CVS Mailing Li

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/Zend/zend_compile.c trunk/Zend/zend_compile.c

2011-12-05 Thread Xinchen Hui
laruence Mon, 05 Dec 2011 12:33:56 +

Revision: http://svn.php.net/viewvc?view=revision&revision=320425

Log:
Fix typo

Changed paths:
U   php/php-src/branches/PHP_5_4/Zend/zend_compile.c
U   php/php-src/trunk/Zend/zend_compile.c

Modified: php/php-src/branches/PHP_5_4/Zend/zend_compile.c
===
--- php/php-src/branches/PHP_5_4/Zend/zend_compile.c2011-12-05 12:22:30 UTC 
(rev 320424)
+++ php/php-src/branches/PHP_5_4/Zend/zend_compile.c2011-12-05 12:33:56 UTC 
(rev 320425)
@@ -2884,7 +2884,7 @@

zend_hash_find(&ce->parent->function_table, lc_parent_class_name, 
ce->parent->name_length+1, (void **)&function)==SUCCESS) {
if (function->common.fn_flags & ZEND_ACC_CTOR) {
/* inherit parent's constructor */
-   zend_hash_update(&ce->function_table, 
lc_parent_class_name, ce->parent->name_length+1, function, 
sizeof(zend_function), (void**)new_function);
+   zend_hash_update(&ce->function_table, 
lc_parent_class_name, ce->parent->name_length+1, function, 
sizeof(zend_function), (void**)&new_function);
function_add_ref(new_function);
}
}

Modified: php/php-src/trunk/Zend/zend_compile.c
===
--- php/php-src/trunk/Zend/zend_compile.c   2011-12-05 12:22:30 UTC (rev 
320424)
+++ php/php-src/trunk/Zend/zend_compile.c   2011-12-05 12:33:56 UTC (rev 
320425)
@@ -2884,7 +2884,7 @@

zend_hash_find(&ce->parent->function_table, lc_parent_class_name, 
ce->parent->name_length+1, (void **)&function)==SUCCESS) {
if (function->common.fn_flags & ZEND_ACC_CTOR) {
/* inherit parent's constructor */
-   zend_hash_update(&ce->function_table, 
lc_parent_class_name, ce->parent->name_length+1, function, 
sizeof(zend_function), (void**)new_function);
+   zend_hash_update(&ce->function_table, 
lc_parent_class_name, ce->parent->name_length+1, function, 
sizeof(zend_function), (void**)&new_function);
function_add_ref(new_function);
}
}

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/Zend/tests/method_static_var.phpt trunk/Zend/tests/method_static_var.phpt

2011-12-05 Thread Xinchen Hui
laruence Mon, 05 Dec 2011 12:44:12 +

Revision: http://svn.php.net/viewvc?view=revision&revision=320428

Log:
Add xfaild test for a secluded issue

Changed paths:
A   php/php-src/branches/PHP_5_4/Zend/tests/method_static_var.phpt
A   php/php-src/trunk/Zend/tests/method_static_var.phpt

Added: php/php-src/branches/PHP_5_4/Zend/tests/method_static_var.phpt
===
--- php/php-src/branches/PHP_5_4/Zend/tests/method_static_var.phpt  
(rev 0)
+++ php/php-src/branches/PHP_5_4/Zend/tests/method_static_var.phpt  
2011-12-05 12:44:12 UTC (rev 320428)
@@ -0,0 +1,34 @@
+--TEST--
+Initial value of static var in method depends on the include time of the class 
definition
+--XFAIL--
+Maybe not a bug
+--FILE--
+-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/Zend/tests/method_static_var.phpt trunk/Zend/tests/method_static_var.phpt

2011-12-05 Thread Xinchen Hui
laruence Mon, 05 Dec 2011 12:46:38 +

Revision: http://svn.php.net/viewvc?view=revision&revision=320430

Log:
remove irrelevant codes in test

Changed paths:
U   php/php-src/branches/PHP_5_4/Zend/tests/method_static_var.phpt
U   php/php-src/trunk/Zend/tests/method_static_var.phpt

Modified: php/php-src/branches/PHP_5_4/Zend/tests/method_static_var.phpt
===
--- php/php-src/branches/PHP_5_4/Zend/tests/method_static_var.phpt  
2011-12-05 12:45:50 UTC (rev 320429)
+++ php/php-src/branches/PHP_5_4/Zend/tests/method_static_var.phpt  
2011-12-05 12:46:38 UTC (rev 320430)
@@ -7,17 +7,13 @@
 class Foo {
  public function __construct() {
   eval("class Bar extends Foo {}");
-  Some::foo($this);
  }
  public static function test() {
   static $i = 0;
   var_dump(++$i);
  }
 }
-class Some {
- public static function foo(Foo $foo) {
- }
-}
+
 foo::test();
 new Foo;
 foo::test();

Modified: php/php-src/trunk/Zend/tests/method_static_var.phpt
===
--- php/php-src/trunk/Zend/tests/method_static_var.phpt 2011-12-05 12:45:50 UTC 
(rev 320429)
+++ php/php-src/trunk/Zend/tests/method_static_var.phpt 2011-12-05 12:46:38 UTC 
(rev 320430)
@@ -7,17 +7,13 @@
 class Foo {
  public function __construct() {
   eval("class Bar extends Foo {}");
-  Some::foo($this);
  }
  public static function test() {
   static $i = 0;
   var_dump(++$i);
  }
 }
-class Some {
- public static function foo(Foo $foo) {
- }
-}
+
 foo::test();
 new Foo;
 foo::test();

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

[PHP-CVS] svn: /php/php-src/trunk/ext/curl/ interface.c

2011-12-05 Thread Pierrick Charron
pierrick Mon, 05 Dec 2011 22:23:19 +

Revision: http://svn.php.net/viewvc?view=revision&revision=320466

Log:
We should free the memory of any curl_slist returned by curl_easy_getinfo

Changed paths:
U   php/php-src/trunk/ext/curl/interface.c

Modified: php/php-src/trunk/ext/curl/interface.c
===
--- php/php-src/trunk/ext/curl/interface.c  2011-12-05 21:55:40 UTC (rev 
320465)
+++ php/php-src/trunk/ext/curl/interface.c  2011-12-05 22:23:19 UTC (rev 
320466)
@@ -3031,6 +3031,7 @@

add_next_index_string(return_value, slist->data, 1);
slist = 
slist->next;
}
+   
curl_slist_free_all(slist);
} else {
RETURN_FALSE;
}

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2011-12-05 Thread Derick Rethans
derick   Tue, 06 Dec 2011 05:44:54 +

Revision: http://svn.php.net/viewvc?view=revision&revision=320475

Log:
This changes adds the --EXTENSION-- section to .phpt files as
described in http://marc.info/?t=13224861637&r=1&w=2.

Changed paths:
U   php/php-src/branches/PHP_5_3/run-tests.php
U   php/php-src/branches/PHP_5_4/run-tests.php
U   php/php-src/trunk/run-tests.php

Modified: php/php-src/branches/PHP_5_3/run-tests.php
===
--- php/php-src/branches/PHP_5_3/run-tests.php  2011-12-06 02:18:08 UTC (rev 
320474)
+++ php/php-src/branches/PHP_5_3/run-tests.php  2011-12-06 05:44:54 UTC (rev 
320475)
@@ -1246,7 +1246,7 @@
}

// Match the beginning of a section.
-   if (preg_match(b'/^--([_A-Z]+)--/', $line, $r)) {
+   if (preg_match('/^--([_A-Z]+)--/', $line, $r)) {
$section = $r[1];
settype($section, 'string');

@@ -1483,6 +1483,18 @@
settings2array(preg_split( "/[\n\r]+/", $section_text['INI']), 
$ini_settings);
}

+   // Additional required extensions
+   if (array_key_exists('EXTENSIONS', $section_text)) {
+   $ext_dir=`$php -r 'echo ini_get("extension_dir");'`;
+   $extensions = preg_split("/[\n\r]+/", 
trim($section_text['EXTENSIONS']));
+   $loaded = explode(",", `$php -n -r 'echo join(",", 
get_loaded_extensions());'`);
+   foreach ($extensions as $req_ext) {
+   if (!in_array($req_ext, $loaded)) {
+   $ini_settings['extension'][] = $ext_dir . 
DIRECTORY_SEPARATOR . $req_ext . '.' . PHP_SHLIB_SUFFIX;
+   }
+   }
+   }
+
settings2params($ini_settings);

// Check if test should be skipped.

Modified: php/php-src/branches/PHP_5_4/run-tests.php
===
--- php/php-src/branches/PHP_5_4/run-tests.php  2011-12-06 02:18:08 UTC (rev 
320474)
+++ php/php-src/branches/PHP_5_4/run-tests.php  2011-12-06 05:44:54 UTC (rev 
320475)
@@ -1246,7 +1246,7 @@
}

// Match the beginning of a section.
-   if (preg_match(b'/^--([_A-Z]+)--/', $line, $r)) {
+   if (preg_match('/^--([_A-Z]+)--/', $line, $r)) {
$section = $r[1];
settype($section, 'string');

@@ -1483,6 +1483,18 @@
settings2array(preg_split( "/[\n\r]+/", $section_text['INI']), 
$ini_settings);
}

+   // Additional required extensions
+   if (array_key_exists('EXTENSIONS', $section_text)) {
+   $ext_dir=`$php -r 'echo ini_get("extension_dir");'`;
+   $extensions = preg_split("/[\n\r]+/", 
trim($section_text['EXTENSIONS']));
+   $loaded = explode(",", `$php -n -r 'echo join(",", 
get_loaded_extensions());'`);
+   foreach ($extensions as $req_ext) {
+   if (!in_array($req_ext, $loaded)) {
+   $ini_settings['extension'][] = $ext_dir . 
DIRECTORY_SEPARATOR . $req_ext . '.' . PHP_SHLIB_SUFFIX;
+   }
+   }
+   }
+
settings2params($ini_settings);

// Check if test should be skipped.

Modified: php/php-src/trunk/run-tests.php
===
--- php/php-src/trunk/run-tests.php 2011-12-06 02:18:08 UTC (rev 320474)
+++ php/php-src/trunk/run-tests.php 2011-12-06 05:44:54 UTC (rev 320475)
@@ -1483,6 +1483,18 @@
settings2array(preg_split( "/[\n\r]+/", $section_text['INI']), 
$ini_settings);
}

+   // Additional required extensions
+   if (array_key_exists('EXTENSIONS', $section_text)) {
+   $ext_dir=`$php -r 'echo ini_get("extension_dir");'`;
+   $extensions = preg_split("/[\n\r]+/", 
trim($section_text['EXTENSIONS']));
+   $loaded = explode(",", `$php -n -r 'echo join(",", 
get_loaded_extensions());'`);
+   foreach ($extensions as $req_ext) {
+   if (!in_array($req_ext, $loaded)) {
+   $ini_settings['extension'][] = $ext_dir . 
DIRECTORY_SEPARATOR . $req_ext . '.' . PHP_SHLIB_SUFFIX;
+   }
+   }
+   }
+
settings2params($ini_settings);

// Check if test should be skipped.

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/tests/bug32555.phpt branches/PHP_5_3/ext/date/tests/bug54851.phpt branches/PHP_5_4/ext/date/tests/bug54851.phpt trunk/ext/date/tests/bug32555.php

2011-12-05 Thread Derick Rethans
derick   Tue, 06 Dec 2011 05:59:24 +

Revision: http://svn.php.net/viewvc?view=revision&revision=320476

Log:
- Fixed test case for #54851.
- Make test case for #32555 the same for all branches.

Bugs: https://bugs.php.net/54851 (Closed) DateTime::createFromFormat, 
$format=='D' or $format=='l' Always Returns Today.
  https://bugs.php.net/32555 (Closed) strtotime("tomorrow") can return false
  
Changed paths:
U   php/php-src/branches/PHP_5_3/ext/date/tests/bug32555.phpt
U   php/php-src/branches/PHP_5_3/ext/date/tests/bug54851.phpt
U   php/php-src/branches/PHP_5_4/ext/date/tests/bug54851.phpt
U   php/php-src/trunk/ext/date/tests/bug32555.phpt
U   php/php-src/trunk/ext/date/tests/bug54851.phpt

Modified: php/php-src/branches/PHP_5_3/ext/date/tests/bug32555.phpt
===
--- php/php-src/branches/PHP_5_3/ext/date/tests/bug32555.phpt   2011-12-06 
05:44:54 UTC (rev 320475)
+++ php/php-src/branches/PHP_5_3/ext/date/tests/bug32555.phpt   2011-12-06 
05:59:24 UTC (rev 320476)
@@ -8,7 +8,6 @@
 date.timezone=US/Eastern
 --FILE--
 format("D"). ' 0 0 0');
+$date2 = DateTime::createFromFormat("D H i s", $date->format("D"). ' 0 00 00');
 echo $date->format("r"), "\n";
 echo $date2->format("r"), "\n";
 var_dump($date->format("D") == $date2->format("D"));
@@ -20,7 +20,7 @@
 // Verify that our implementation is the same as for the constructor and
 // strtotime
 $date1 = new DateTime("Tuesday");
-$date2 = DateTime::createFromFormat("D H i s", "Tuesday 0 0 0");
+$date2 = DateTime::createFromFormat("D H i s", "Tuesday 0 00 00");
 echo $date1->format('r'), "\n";
 echo $date2->format('r'), "\n";
 var_dump($date1->format('D') == $date2->format('D'));

Modified: php/php-src/branches/PHP_5_4/ext/date/tests/bug54851.phpt
===
--- php/php-src/branches/PHP_5_4/ext/date/tests/bug54851.phpt   2011-12-06 
05:44:54 UTC (rev 320475)
+++ php/php-src/branches/PHP_5_4/ext/date/tests/bug54851.phpt   2011-12-06 
05:59:24 UTC (rev 320476)
@@ -5,7 +5,7 @@
 --FILE--
 format("D"). ' 0 0 0');
+$date2 = DateTime::createFromFormat("D H i s", $date->format("D"). ' 0 00 00');
 echo $date->format("r"), "\n";
 echo $date2->format("r"), "\n";
 var_dump($date->format("D") == $date2->format("D"));
@@ -20,7 +20,7 @@
 // Verify that our implementation is the same as for the constructor and
 // strtotime
 $date1 = new DateTime("Tuesday");
-$date2 = DateTime::createFromFormat("D H i s", "Tuesday 0 0 0");
+$date2 = DateTime::createFromFormat("D H i s", "Tuesday 0 00 00");
 echo $date1->format('r'), "\n";
 echo $date2->format('r'), "\n";
 var_dump($date1->format('D') == $date2->format('D'));

Modified: php/php-src/trunk/ext/date/tests/bug32555.phpt
===
--- php/php-src/trunk/ext/date/tests/bug32555.phpt  2011-12-06 05:44:54 UTC 
(rev 320475)
+++ php/php-src/trunk/ext/date/tests/bug32555.phpt  2011-12-06 05:59:24 UTC 
(rev 320476)
@@ -8,7 +8,6 @@
 date.timezone=US/Eastern
 --FILE--
 format("D"). ' 0 0 0');
+$date2 = DateTime::createFromFormat("D H i s", $date->format("D"). ' 0 00 00');
 echo $date->format("r"), "\n";
 echo $date2->format("r"), "\n";
 var_dump($date->format("D") == $date2->format("D"));
@@ -20,7 +20,7 @@
 // Verify that our implementation is the same as for the constructor and
 // strtotime
 $date1 = new DateTime("Tuesday");
-$date2 = DateTime::createFromFormat("D H i s", "Tuesday 0 0 0");
+$date2 = DateTime::createFromFormat("D H i s", "Tuesday 0 00 00");
 echo $date1->format('r'), "\n";
 echo $date2->format('r'), "\n";
 var_dump($date1->format('D') == $date2->format('D'));

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/tests/bug48678.phpt branches/PHP_5_4/ext/date/tests/bug48678.phpt trunk/ext/date/tests/bug48678.phpt

2011-12-05 Thread Derick Rethans
derick   Tue, 06 Dec 2011 06:00:45 +

Revision: http://svn.php.net/viewvc?view=revision&revision=320477

Log:
- Cosmetics for test case for #48678.

Bug: https://bugs.php.net/48678 (Closed) DateInterval segfaults when 
unserialising
  
Changed paths:
U   php/php-src/branches/PHP_5_3/ext/date/tests/bug48678.phpt
U   php/php-src/branches/PHP_5_4/ext/date/tests/bug48678.phpt
U   php/php-src/trunk/ext/date/tests/bug48678.phpt

Modified: php/php-src/branches/PHP_5_3/ext/date/tests/bug48678.phpt
===
--- php/php-src/branches/PHP_5_3/ext/date/tests/bug48678.phpt   2011-12-06 
05:59:24 UTC (rev 320476)
+++ php/php-src/branches/PHP_5_3/ext/date/tests/bug48678.phpt   2011-12-06 
06:00:45 UTC (rev 320477)
@@ -1,8 +1,8 @@
 --TEST--
-Bug #48678 DateInterval segfaults when unserialising
+Bug #48678: DateInterval segfaults when unserialising
 --FILE--
 -- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/lib/parse_iso_intervals.c branches/PHP_5_3/ext/date/lib/parse_iso_intervals.re branches/PHP_5_3/ext/date/tests/bug52062.phpt branches/PHP_5_4/ext

2011-12-05 Thread Derick Rethans
derick   Tue, 06 Dec 2011 06:04:24 +

Revision: http://svn.php.net/viewvc?view=revision&revision=320478

Log:
- Fixed bug #52062: large timestamps with DateTime::getTimestamp and 
DateTime::setTimestamp.

Bug: https://bugs.php.net/52062 (Assigned) large timestamps with 
DateTime::getTimestamp and DateTime::setTimestamp
  
Changed paths:
U   php/php-src/branches/PHP_5_3/ext/date/lib/parse_iso_intervals.c
U   php/php-src/branches/PHP_5_3/ext/date/lib/parse_iso_intervals.re
A   php/php-src/branches/PHP_5_3/ext/date/tests/bug52062.phpt
U   php/php-src/branches/PHP_5_4/ext/date/lib/parse_iso_intervals.c
U   php/php-src/branches/PHP_5_4/ext/date/lib/parse_iso_intervals.re
A   php/php-src/branches/PHP_5_4/ext/date/tests/bug52062.phpt
U   php/php-src/trunk/ext/date/lib/parse_iso_intervals.c
U   php/php-src/trunk/ext/date/lib/parse_iso_intervals.re
A   php/php-src/trunk/ext/date/tests/bug52062.phpt

Modified: php/php-src/branches/PHP_5_3/ext/date/lib/parse_iso_intervals.c
===
--- php/php-src/branches/PHP_5_3/ext/date/lib/parse_iso_intervals.c 
2011-12-06 06:00:45 UTC (rev 320477)
+++ php/php-src/branches/PHP_5_3/ext/date/lib/parse_iso_intervals.c 
2011-12-06 06:04:24 UTC (rev 320478)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Sat Nov 13 14:57:59 2010 */
+/* Generated by re2c 0.13.5 on Mon Dec  5 22:02:31 2011 */
 #line 1 "ext/date/lib/parse_iso_intervals.re"
 /*
+--+
@@ -396,7 +396,7 @@
break;
}

-   nr = timelib_get_unsigned_nr((char **) &ptr, 9);
+   nr = timelib_get_unsigned_nr((char **) &ptr, 12);
switch (*ptr) {
case 'Y': s->period->y = nr; break;
case 'W': s->period->d = nr * 7; break;

Modified: php/php-src/branches/PHP_5_3/ext/date/lib/parse_iso_intervals.re
===
--- php/php-src/branches/PHP_5_3/ext/date/lib/parse_iso_intervals.re
2011-12-06 06:00:45 UTC (rev 320477)
+++ php/php-src/branches/PHP_5_3/ext/date/lib/parse_iso_intervals.re
2011-12-06 06:04:24 UTC (rev 320478)
@@ -364,7 +364,7 @@
break;
}

-   nr = timelib_get_unsigned_nr((char **) &ptr, 9);
+   nr = timelib_get_unsigned_nr((char **) &ptr, 12);
switch (*ptr) {
case 'Y': s->period->y = nr; break;
case 'W': s->period->d = nr * 7; break;

Added: php/php-src/branches/PHP_5_3/ext/date/tests/bug52062.phpt
===
--- php/php-src/branches/PHP_5_3/ext/date/tests/bug52062.phpt   
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/date/tests/bug52062.phpt   2011-12-06 
06:04:24 UTC (rev 320478)
@@ -0,0 +1,21 @@
+--TEST--
+Bug #52062: large timestamps with DateTime::getTimestamp and 
DateTime::setTimestamp
+--FILE--
+format('Y-m-d H:i:s U'));
+var_dump($d->getTimestamp());
+
+$d->setTimestamp(1000);
+var_dump($d->format('Y-m-d H:i:s U'));
+var_dump($d->getTimestamp());
+
+$i = new DateInterval('PT1000S');
+var_dump($i->format('%s'));
+?>
+--EXPECT--
+string(32) "5138-11-16 09:46:40 1000"
+int(1000)
+string(32) "5138-11-16 09:46:40 1000"
+int(1000)
+string(12) "1000"

Modified: php/php-src/branches/PHP_5_4/ext/date/lib/parse_iso_intervals.c
===
--- php/php-src/branches/PHP_5_4/ext/date/lib/parse_iso_intervals.c 
2011-12-06 06:00:45 UTC (rev 320477)
+++ php/php-src/branches/PHP_5_4/ext/date/lib/parse_iso_intervals.c 
2011-12-06 06:04:24 UTC (rev 320478)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Sat Nov 13 14:56:07 2010 */
+/* Generated by re2c 0.13.5 on Mon Dec  5 22:02:27 2011 */
 #line 1 "ext/date/lib/parse_iso_intervals.re"
 /*
+--+
@@ -396,7 +396,7 @@
break;
}

-   nr = timelib_get_unsigned_nr((char **) &ptr, 9);
+   nr = timelib_get_unsigned_nr((char **) &ptr, 12);
switch (*ptr) {
case 'Y': s->period->y = nr; break;
case 'W': s->period->d = nr * 7; break;

Modified: php/php-src/branches/PHP_5_4/ext/date/lib/parse_iso_intervals.re
===
--- php/php-src/branches/PHP_5_4/ext/date/lib/parse_iso_intervals.re
2011-12-06 06:00:45 UTC (rev 320477)
+++ php/php-src/branches/PHP_5_4/ext/dat

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/tests/bug53437.phpt branches/PHP_5_4/ext/date/tests/bug53437.phpt trunk/ext/date/tests/bug53437.phpt

2011-12-05 Thread Derick Rethans
derick   Tue, 06 Dec 2011 06:07:41 +

Revision: http://svn.php.net/viewvc?view=revision&revision=320479

Log:
- Added a test case for #53437.

Bug: https://bugs.php.net/53437 (Assigned) Crash when using unserialized 
DatePeriod instance
  
Changed paths:
A   php/php-src/branches/PHP_5_3/ext/date/tests/bug53437.phpt
A   php/php-src/branches/PHP_5_4/ext/date/tests/bug53437.phpt
A   php/php-src/trunk/ext/date/tests/bug53437.phpt

Added: php/php-src/branches/PHP_5_3/ext/date/tests/bug53437.phpt
===
--- php/php-src/branches/PHP_5_3/ext/date/tests/bug53437.phpt   
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/date/tests/bug53437.phpt   2011-12-06 
06:07:41 UTC (rev 320479)
@@ -0,0 +1,28 @@
+--TEST--
+Bug #53437: Crash when using unserialized DatePeriod instance
+--XFAIL--
+Bug #53437 Not fixed yet
+--FILE--
+format('Y-m-d H:i:s')."\r\n";
+}
+echo "\r\n";
+var_dump($dp);
+
+$ser = serialize($dp); // $ser is: O:10:"DatePeriod":0:{}
+
+// Create dangerous instance
+$dpu = unserialize($ser); // $dpu has invalid values???
+var_dump($dpu);
+
+echo "Unserialized:\r\n";
+// ???which leads to CRASH:
+foreach($dpu as $dt) {
+echo $dt->format('Y-m-d H:i:s')."\r\n";
+}
+?>
+--EXPECT--

Added: php/php-src/branches/PHP_5_4/ext/date/tests/bug53437.phpt
===
--- php/php-src/branches/PHP_5_4/ext/date/tests/bug53437.phpt   
(rev 0)
+++ php/php-src/branches/PHP_5_4/ext/date/tests/bug53437.phpt   2011-12-06 
06:07:41 UTC (rev 320479)
@@ -0,0 +1,28 @@
+--TEST--
+Bug #53437: Crash when using unserialized DatePeriod instance
+--XFAIL--
+Bug #53437 Not fixed yet
+--FILE--
+format('Y-m-d H:i:s')."\r\n";
+}
+echo "\r\n";
+var_dump($dp);
+
+$ser = serialize($dp); // $ser is: O:10:"DatePeriod":0:{}
+
+// Create dangerous instance
+$dpu = unserialize($ser); // $dpu has invalid values???
+var_dump($dpu);
+
+echo "Unserialized:\r\n";
+// ???which leads to CRASH:
+foreach($dpu as $dt) {
+echo $dt->format('Y-m-d H:i:s')."\r\n";
+}
+?>
+--EXPECT--

Added: php/php-src/trunk/ext/date/tests/bug53437.phpt
===
--- php/php-src/trunk/ext/date/tests/bug53437.phpt  
(rev 0)
+++ php/php-src/trunk/ext/date/tests/bug53437.phpt  2011-12-06 06:07:41 UTC 
(rev 320479)
@@ -0,0 +1,28 @@
+--TEST--
+Bug #53437: Crash when using unserialized DatePeriod instance
+--XFAIL--
+Bug #53437 Not fixed yet
+--FILE--
+format('Y-m-d H:i:s')."\r\n";
+}
+echo "\r\n";
+var_dump($dp);
+
+$ser = serialize($dp); // $ser is: O:10:"DatePeriod":0:{}
+
+// Create dangerous instance
+$dpu = unserialize($ser); // $dpu has invalid values???
+var_dump($dpu);
+
+echo "Unserialized:\r\n";
+// ???which leads to CRASH:
+foreach($dpu as $dt) {
+echo $dt->format('Y-m-d H:i:s')."\r\n";
+}
+?>
+--EXPECT--

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

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/date/tests/ date.phpt mktime-2.phpt timezone-configuration.phpt

2011-12-05 Thread Derick Rethans
derick   Tue, 06 Dec 2011 06:13:41 +

Revision: http://svn.php.net/viewvc?view=revision&revision=320480

Log:
Make tests similar to the ones in 5.4 and trunk.

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/date/tests/date.phpt
U   php/php-src/branches/PHP_5_3/ext/date/tests/mktime-2.phpt
U   php/php-src/branches/PHP_5_3/ext/date/tests/timezone-configuration.phpt

Modified: php/php-src/branches/PHP_5_3/ext/date/tests/date.phpt
===
--- php/php-src/branches/PHP_5_3/ext/date/tests/date.phpt   2011-12-06 
06:07:41 UTC (rev 320479)
+++ php/php-src/branches/PHP_5_3/ext/date/tests/date.phpt   2011-12-06 
06:13:41 UTC (rev 320480)
@@ -3,22 +3,14 @@
 --FILE--
 -- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ NEWS

2011-12-05 Thread Derick Rethans
derick   Tue, 06 Dec 2011 06:23:13 +

Revision: http://svn.php.net/viewvc?view=revision&revision=320482

Log:
- Fixed bug number.

Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2011-12-06 06:21:08 UTC (rev 320481)
+++ php/php-src/branches/PHP_5_3/NEWS   2011-12-06 06:23:13 UTC (rev 320482)
@@ -49,7 +49,7 @@
 DateTime::setTimestamp). (Derick)
   . Fixed bug #51994 (date_parse_from_format is parsing invalid date using 'yz'
 format). (Derick)
-  . Fixed bug #51223 (Seg fault while creating (by unserialization)
+  . Fixed bug #52113 (Seg fault while creating (by unserialization)
 DatePeriod). (Derick)

 - EXIF:

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/Zend/zend_compile.c trunk/Zend/zend_compile.c

2011-12-05 Thread Pierrick Charron
pierrick Tue, 06 Dec 2011 06:44:22 +

Revision: http://svn.php.net/viewvc?view=revision&revision=320485

Log:
Coding standard

Changed paths:
U   php/php-src/branches/PHP_5_4/Zend/zend_compile.c
U   php/php-src/trunk/Zend/zend_compile.c

Modified: php/php-src/branches/PHP_5_4/Zend/zend_compile.c
===
--- php/php-src/branches/PHP_5_4/Zend/zend_compile.c2011-12-06 06:30:46 UTC 
(rev 320484)
+++ php/php-src/branches/PHP_5_4/Zend/zend_compile.c2011-12-06 06:44:22 UTC 
(rev 320485)
@@ -6486,7 +6486,7 @@

GET_NODE(colon_token, opline->result);

-   jmp_token->u.op .opline_num = op_number;
+   jmp_token->u.op.opline_num = op_number;

INC_BPC(CG(active_op_array));
 }

Modified: php/php-src/trunk/Zend/zend_compile.c
===
--- php/php-src/trunk/Zend/zend_compile.c   2011-12-06 06:30:46 UTC (rev 
320484)
+++ php/php-src/trunk/Zend/zend_compile.c   2011-12-06 06:44:22 UTC (rev 
320485)
@@ -6486,7 +6486,7 @@

GET_NODE(colon_token, opline->result);

-   jmp_token->u.op .opline_num = op_number;
+   jmp_token->u.op.opline_num = op_number;

INC_BPC(CG(active_op_array));
 }

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