[PHP-CVS] com php-src: tab: Zend/zend_compile.h

2012-08-17 Thread Xinchen Hui
Commit:57e7c7bd49dae25f2d3ec935b5e264d0fb62b6b3
Author:Xinchen Hui  Sat, 18 Aug 2012 11:57:53 
+0800
Parents:   72b9b8f380690357fc29efdfcba183b8a8a81268
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=57e7c7bd49dae25f2d3ec935b5e264d0fb62b6b3

Log:
tab

Changed paths:
  M  Zend/zend_compile.h


Diff:
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index a06c985..8919fdc 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -80,7 +80,7 @@ typedef union _znode_op {
zend_op   *jmp_addr;
zval  *zv;
zend_literal  *literal;
-  void  *ptr;/* Used for passing pointers from the compile to 
execution phase, currently used for traits */
+   void  *ptr;/* Used for passing pointers from the 
compile to execution phase, currently used for traits */
 } znode_op;
 
 typedef struct _znode { /* used only during compilation */


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



[PHP-CVS] com php-src: Fix test failed: sapi/cgi/tests/apache_request_headers.phpt

2012-08-17 Thread Xinchen Hui
Commit:ebefbdb76d7e16c03dc9f3cf761bff6656af42c0
Author:Xinchen Hui  Sat, 18 Aug 2012 12:21:48 
+0800
Parents:   15e31d5720786cda4188f258e3b2fe7b0e9ba004
Branches:  PHP-5.4

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=ebefbdb76d7e16c03dc9f3cf761bff6656af42c0

Log:
Fix test failed

Changed paths:
  M  sapi/cgi/tests/apache_request_headers.phpt


Diff:
diff --git a/sapi/cgi/tests/apache_request_headers.phpt 
b/sapi/cgi/tests/apache_request_headers.phpt
index 881b6bb..fd36e30 100644
--- a/sapi/cgi/tests/apache_request_headers.phpt
+++ b/sapi/cgi/tests/apache_request_headers.phpt
@@ -17,12 +17,12 @@ $file = dirname(__FILE__)."/012.test.php";
 
 file_put_contents($file, '');
 
-passthru("$php $file");
+passthru("$php -n $file");
 
 $names = array('HTTP_X_TEST', 'HTTP_X__TEST', 'HTTP_X_');
 foreach ($names as $name) {
putenv($name."=".str_repeat("A", 256));
-   passthru("$php -q $file");
+   passthru("$php -n -q $file");
putenv($name);
 }
 unlink($file);


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



[PHP-CVS] com php-src: Make the codes clearer, and also check continue statement: Zend/tests/try_finally_008.phpt Zend/tests/try_finally_009.phpt Zend/zend_opcode.c Zend/zend_vm_def.h Zend/zend_vm_exe

2012-08-17 Thread Xinchen Hui
Commit:72b9b8f380690357fc29efdfcba183b8a8a81268
Author:Xinchen Hui  Sat, 18 Aug 2012 11:44:09 
+0800
Parents:   7cf9ac1420ecb1b05a7899e50e91772afe3fcdfb
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=72b9b8f380690357fc29efdfcba183b8a8a81268

Log:
Make the codes clearer, and also check continue statement

Changed paths:
  M  Zend/tests/try_finally_008.phpt
  A  Zend/tests/try_finally_009.phpt
  M  Zend/zend_opcode.c
  M  Zend/zend_vm_def.h
  M  Zend/zend_vm_execute.h


Diff:
diff --git a/Zend/tests/try_finally_008.phpt b/Zend/tests/try_finally_008.phpt
index 77ecf4f..9025d88 100644
--- a/Zend/tests/try_finally_008.phpt
+++ b/Zend/tests/try_finally_008.phpt
@@ -7,15 +7,12 @@ function foo () {
 try {
 try {
 } finally {
-goto label;
-echo "dummy";
+break;
 }
 } catch (Exception $e) {
 } finally {
 }
 } while (0);
-label:
-echo "label"; 
 }
 
 foo();
diff --git a/Zend/tests/try_finally_009.phpt b/Zend/tests/try_finally_009.phpt
new file mode 100644
index 000..7c3da67
--- /dev/null
+++ b/Zend/tests/try_finally_009.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Finally with jmp (for continue)
+--FILE--
+
+--EXPECTF--
+Fatal error: jump out of a finally block is disallowed in 
%stry_finally_009.php on line %d
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index 8cccfe6..86144d6 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -485,6 +485,24 @@ static void zend_extension_op_array_handler(zend_extension 
*extension, zend_op_a
}
 }
 
+static void zend_check_finally_breakout(zend_op_array *op_array, zend_op 
*opline, zend_uint dst_num TSRMLS_DC) {
+   zend_uint i, op_num = opline - op_array->opcodes;
+   for (i=0; i < op_array->last_try_catch; i++) {
+   if (op_array->try_catch_array[i].try_op > op_num) {
+   break;
+   }
+   if ((op_num >= op_array->try_catch_array[i].finally_op 
+   && op_num < 
op_array->try_catch_array[i].finally_end)
+   && (dst_num >= 
op_array->try_catch_array[i].finally_end 
+   || dst_num < 
op_array->try_catch_array[i].finally_op)) {
+   CG(in_compilation) = 1;
+   CG(active_op_array) = op_array;
+   CG(zend_lineno) = opline->lineno;
+   zend_error(E_COMPILE_ERROR, "jump out of a finally 
block is disallowed");
+   }
+   } 
+}
+
 ZEND_API int pass_two(zend_op_array *op_array TSRMLS_DC)
 {
zend_op *opline, *end;
@@ -529,23 +547,29 @@ ZEND_API int pass_two(zend_op_array *op_array TSRMLS_DC)
/* break omitted intentionally */
case ZEND_JMP:
if (op_array->last_try_catch) {
+   zend_check_finally_breakout(op_array, 
opline, opline->op1.opline_num TSRMLS_CC);
+   }
+   opline->op1.jmp_addr = 
&op_array->opcodes[opline->op1.opline_num];
+   break;
+case ZEND_BRK:
+case ZEND_CONT:
+   if (op_array->last_try_catch) {
zend_uint i, op_num = opline - 
op_array->opcodes;
-   for (i=0; i < op_array->last_try_catch; 
i++) {
-   if 
(op_array->try_catch_array[i].try_op > op_num) {
-   break;
+   int nest_levels, array_offset;
+   zend_brk_cont_element *jmp_to;
+
+   nest_levels = Z_LVAL_P(opline->op2.zv);
+   array_offset = opline->op1.opline_num;
+   do {
+   jmp_to = 
&op_array->brk_cont_array[array_offset];
+   if (nest_levels > 1) {
+   array_offset = 
jmp_to->parent;
}
-   if ((op_num >= 
op_array->try_catch_array[i].finally_op 
-   && 
op_num < op_array->try_catch_array[i].finally_end)
-   && 
(opline->op1.opline_num >= op_array->try_catch_array[i].finally_end 
-   || 
opline->op1.opline_num < op_array->try_catch_array[i].finally_op)) {
-   CG(in_compilation) = 1;
- 

[PHP-CVS] com php-src: More intl tests extracted from symfony: ext/intl/symfony_format_type_double_intl1.phpt ext/intl/symfony_format_type_double_intl2.phpt ext/intl/symfony_format_type_double_intl3.p

2012-08-17 Thread Anatoliy Belsky
Commit:1a23d42909070269d53fc7500d683e88ba219cb3
Author:Matt Ficken  Fri, 17 Aug 2012 20:29:08 
+0200
Committer: Anatoliy Belsky   Fri, 17 Aug 2012 20:29:08 +0200
Parents:   9cf0139460c7531ebe8fdd523ba6cf7067a7f282
Branches:  PHP-5.3 PHP-5.4 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=1a23d42909070269d53fc7500d683e88ba219cb3

Log:
More intl tests extracted from symfony

Changed paths:
  A  ext/intl/symfony_format_type_double_intl1.phpt
  A  ext/intl/symfony_format_type_double_intl2.phpt
  A  ext/intl/symfony_format_type_double_intl3.phpt
  A  ext/intl/symfony_format_type_double_intl4.phpt
  A  ext/intl/symfony_format_type_int32_intl1.phpt
  A  ext/intl/symfony_format_type_int32_intl2.phpt
  A  ext/intl/symfony_format_type_int32_intl3.phpt
  A  ext/intl/symfony_format_type_int32_intl4.phpt
  A  ext/intl/symfony_format_type_int32_intl5.phpt
  A  ext/intl/symfony_format_type_int32_intl6.phpt
  A  ext/intl/symfony_format_type_int32_intl7.phpt
  A  ext/intl/symfony_format_type_int64_intl1.phpt
  A  ext/intl/symfony_format_type_int64_intl2.phpt
  A  ext/intl/symfony_format_type_int64_intl3.phpt
  A  ext/intl/symfony_format_type_int64_intl4.phpt
  A  ext/intl/symfony_format_type_int64_intl5.phpt
  A  ext/intl/symfony_format_type_int64_intl6.phpt
  A  ext/intl/symfony_format_type_int64_intl7.phpt
  A  ext/intl/symfony_format_type_int64_intl8.phpt

diff --git a/ext/intl/symfony_format_type_double_intl1.phpt 
b/ext/intl/symfony_format_type_double_intl1.phpt
new file mode 100644
index 000..13a7ad7
--- /dev/null
+++ b/ext/intl/symfony_format_type_double_intl1.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Symfony StubNumberFormatterTest#testFormatTypeDoubleIntl #1
+--SKIPIF--
+
+--FILE--
+format($unit_test_args[1], \NumberFormatter::TYPE_DOUBLE);
+
+echo "== didn't crash ==".PHP_EOL;
+
+?>
+--EXPECT--
+array(3) {
+  [0]=>
+  object(NumberFormatter)#1 (0) {
+  }
+  [1]=>
+  int(1)
+  [2]=>
+  string(1) "1"
+}
+== didn't crash ==
diff --git a/ext/intl/symfony_format_type_double_intl2.phpt 
b/ext/intl/symfony_format_type_double_intl2.phpt
new file mode 100644
index 000..6bff7cc
--- /dev/null
+++ b/ext/intl/symfony_format_type_double_intl2.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Symfony StubNumberFormatterTest#testFormatTypeDoubleIntl #2
+--SKIPIF--
+
+--FILE--
+format($unit_test_args[1], \NumberFormatter::TYPE_DOUBLE);
+
+echo "== didn't crash ==".PHP_EOL;
+
+?>
+--EXPECT--
+array(3) {
+  [0]=>
+  object(NumberFormatter)#1 (0) {
+  }
+  [1]=>
+  float(1.1)
+  [2]=>
+  string(3) "1.1"
+}
+== didn't crash ==
diff --git a/ext/intl/symfony_format_type_double_intl3.phpt 
b/ext/intl/symfony_format_type_double_intl3.phpt
new file mode 100644
index 000..3b0d576
--- /dev/null
+++ b/ext/intl/symfony_format_type_double_intl3.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Symfony StubNumberFormatterTest#testFormatTypeDoubleIntl #3
+--SKIPIF--
+
+--FILE--
+format($unit_test_args[1], \NumberFormatter::TYPE_DOUBLE);
+
+echo "== didn't crash ==".PHP_EOL;
+
+?>
+--EXPECT--
+array(3) {
+  [0]=>
+  object(NumberFormatter)#1 (0) {
+  }
+  [1]=>
+  int(1)
+  [2]=>
+  string(7) "SFD1.00"
+}
+== didn't crash ==
diff --git a/ext/intl/symfony_format_type_double_intl4.phpt 
b/ext/intl/symfony_format_type_double_intl4.phpt
new file mode 100644
index 000..3476e10
--- /dev/null
+++ b/ext/intl/symfony_format_type_double_intl4.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Symfony StubNumberFormatterTest#testFormatTypeDoubleIntl #4
+--SKIPIF--
+
+--FILE--
+format($unit_test_args[1], \NumberFormatter::TYPE_DOUBLE);
+
+echo "== didn't crash ==".PHP_EOL;
+
+?>
+--EXPECT--
+array(3) {
+  [0]=>
+  object(NumberFormatter)#1 (0) {
+  }
+  [1]=>
+  float(1.1)
+  [2]=>
+  string(7) "SFD1.10"
+}
+== didn't crash ==
diff --git a/ext/intl/symfony_format_type_int32_intl1.phpt 
b/ext/intl/symfony_format_type_int32_intl1.phpt
new file mode 100644
index 000..2867b35
--- /dev/null
+++ b/ext/intl/symfony_format_type_int32_intl1.phpt
@@ -0,0 +1,49 @@
+--TEST--
+Symfony StubNumberFormatterTest#testFormatTypeInt32Intl #1
+--SKIPIF--
+
+--FILE--
+format($unit_test_args[1], \NumberFormatter::TYPE_INT32);
+
+echo "== didn't crash ==".PHP_EOL;
+
+?>
+--EXPECT--
+array(3) {
+  [0]=>
+  object(NumberFormatter)#1 (0) {
+  }
+  [1]=>
+  int(1)
+  [2]=>
+  string(1) "1"
+}
+== didn't crash ==
diff --git a/ext/intl/symfony_format_type_int32_intl2.phpt 
b/ext/intl/symfony_format_type_int32_intl2.phpt
new file mode 100644
index 000..6a65a0a
--- /dev/null
+++ b/ext/intl/symfony_format_type_int32_intl2.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Symfony StubNumberFormatterTest#testFormatTypeInt32Intl #2
+--SKIPIF--
+
+--FILE--
+format($unit_test_args[1], \NumberFormatter::TYPE_INT32);
+
+echo "== didn't crash ==".PHP_EOL;
+
+?>
+--EXPECT--
+array(3) {
+  [0]=>
+  object(NumberFormatter)#1 (0) {
+  }
+  [1]=>
+  float(1.1)
+  [2]=>
+  string(1) "1"
+}
+== didn't crash ==
diff --git a/ext/intl/symfony_format_type_int32_intl3.phpt 
b/ext/intl/symfony_format_type_int32_intl3.phpt

[PHP-CVS] com php-src: Annother attempt at fixing the mysqli_fetch_field tests: ext/mysqli/tests/connect.inc ext/mysqli/tests/mysqli_fetch_field.phpt ext/mysqli/tests/mysqli_fetch_field_oo.phpt ext/my

2012-08-17 Thread Nikita Popov
Commit:294e7c295fe55372fb93d4dbbf3ccb7ac785cb4a
Author:Nikita Popov  Fri, 17 Aug 2012 15:17:29 +0200
Parents:   f2a8912e618d4bd8ff5be266e37f2b6e2280e994
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=294e7c295fe55372fb93d4dbbf3ccb7ac785cb4a

Log:
Annother attempt at fixing the mysqli_fetch_field tests

Instead of character set detection (which doesn't always work correctly)
fetch the character set info using mysqli_get_charset(). To make sure that
the returned info applies to all of client, connection and result
explicitely set utf8 as charset using mysqli_set_charset() before. I'm not
sure whether that last part is really necessary, but included it to be
safe.

Changed paths:
  M  ext/mysqli/tests/connect.inc
  M  ext/mysqli/tests/mysqli_fetch_field.phpt
  M  ext/mysqli/tests/mysqli_fetch_field_oo.phpt
  M  ext/mysqli/tests/mysqli_fetch_fields.phpt
  M  ext/mysqli/tests/mysqli_field_seek.phpt
  M  ext/mysqli/tests/mysqli_stmt_get_result_metadata_fetch_field.phpt

diff --git a/ext/mysqli/tests/connect.inc b/ext/mysqli/tests/connect.inc
index 3a9d8ec..4acc20c 100644
--- a/ext/mysqli/tests/connect.inc
+++ b/ext/mysqli/tests/connect.inc
@@ -129,99 +129,6 @@
}
}
 
-   function my_get_charsets($link) {
-
-   /* Those tree are set by SET NAMES */
-   $charsets = array(
-   'client'=> NULL,
-   'results'   => NULL,
-   'connection'=> NULL,
-   );
-
-   if (!($res = mysqli_query($link, "SHOW VARIABLES LIKE 
'%character%'"))) {
-   printf("[%d] %s\n", mysqli_errno($link), 
mysqli_error($link));
-   return $charsets;
-   }
-
-   $names = array();
-   while ($row = mysqli_fetch_assoc($res)) {
-   $names[$row['Variable_name']] = $row['Value'];
-   }
-   mysqli_free_result($res);
-
-   if (!($res = mysqli_query($link, sprintf("SHOW 
CHARACTER SET LIKE '%s'", $names['character_set_client']))) ||
-   !($details = mysqli_fetch_assoc($res))) {
-   printf("[%d] %s\n", mysqli_errno($link), 
mysqli_error($link));
-   return $charsets;
-   }
-   mysqli_free_result($res);
-
-   $charsets['client'] = array(
-   'charset'   => $details['Charset'],
-   'desc'  => $details['Description'],
-   'collation' => $details['Default 
collation'],
-   'maxlen'=> $details['Maxlen'],
-   'nr'=> NULL,
-   );
-
-   if (!($res = mysqli_query($link, sprintf("SHOW 
COLLATION LIKE '%s'", $details['Default collation']))) ||
-   !($collation = mysqli_fetch_assoc($res))) {
-   printf("[%d] %s\n", mysqli_errno($link), 
mysqli_error($link));
-   return $charsets;
-   }
-   mysqli_free_result($res);
-   $charsets['client']['nr'] = $collation['Id'];
-
-   if (!($res = mysqli_query($link, sprintf("SHOW 
CHARACTER SET LIKE '%s'", $names['character_set_results']))) ||
-   !($details = mysqli_fetch_assoc($res))) {
-   printf("[%d] %s\n", mysqli_errno($link), 
mysqli_error($link));
-   return $charsets;
-   }
-   mysqli_free_result($res);
-
-   $charsets['results'] = array(
-   'charset'   => $details['Charset'],
-   'desc'  => $details['Description'],
-   'collation' => $details['Default 
collation'],
-   'maxlen'=> $details['Maxlen'],
-   'nr'=> NULL,
-   );
-
-   if (!($res = mysqli_query($link, sprintf("SHOW 
COLLATION LIKE '%s'", $details['Default collation']))) ||
-   !($collation = mysqli_fetch_assoc($res))) {
-   printf("[%d] %s\n", mysqli_errno($link), 
mysqli_error($link));
-   return $charsets;
-   }
-   mysqli_free_result($res);
-   $charsets['results']['nr'] = $collation['Id'];
-
-
-   if (!($res = mysqli_query($link, sprintf("

[PHP-CVS] com php-src: Refactor examing of jumping out of finally block: Zend/tests/try_finally_005.phpt Zend/tests/try_finally_006.phpt Zend/tests/try_finally_007.phpt Zend/tests/try_finally_008.phpt

2012-08-17 Thread Xinchen Hui
Commit:f2a8912e618d4bd8ff5be266e37f2b6e2280e994
Author:Xinchen Hui  Sat, 18 Aug 2012 00:16:34 
+0800
Parents:   24493652382c985b13a9ed94aae5fffae16a6895
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=f2a8912e618d4bd8ff5be266e37f2b6e2280e994

Log:
Refactor examing of jumping out of finally block

Changed paths:
  M  Zend/tests/try_finally_005.phpt
  M  Zend/tests/try_finally_006.phpt
  A  Zend/tests/try_finally_007.phpt
  A  Zend/tests/try_finally_008.phpt
  M  Zend/zend_compile.c
  M  Zend/zend_compile.h
  M  Zend/zend_opcode.c


Diff:
diff --git a/Zend/tests/try_finally_005.phpt b/Zend/tests/try_finally_005.phpt
index e0937f1..2c6c2c9 100644
--- a/Zend/tests/try_finally_005.phpt
+++ b/Zend/tests/try_finally_005.phpt
@@ -14,4 +14,4 @@ label:
 foo();
 ?>
 --EXPECTF--
-Fatal error: 'goto' out of a finally block is disallowed in 
%stry_finally_005.php on line %d
+Fatal error: jump out of a finally block is disallowed in 
%stry_finally_005.php on line %d
diff --git a/Zend/tests/try_finally_006.phpt b/Zend/tests/try_finally_006.phpt
index ba1c183..2bfa4ca 100644
--- a/Zend/tests/try_finally_006.phpt
+++ b/Zend/tests/try_finally_006.phpt
@@ -3,12 +3,19 @@ Finally with near goto
 --FILE--
 
 --EXPECTF--
 label
+okey
diff --git a/Zend/tests/try_finally_007.phpt b/Zend/tests/try_finally_007.phpt
new file mode 100644
index 000..b13bd59
--- /dev/null
+++ b/Zend/tests/try_finally_007.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Finally with goto previous label
+--FILE--
+
+--EXPECTF--
+Fatal error: jump out of a finally block is disallowed in 
%stry_finally_007.php on line %d
diff --git a/Zend/tests/try_finally_008.phpt b/Zend/tests/try_finally_008.phpt
new file mode 100644
index 000..77ecf4f
--- /dev/null
+++ b/Zend/tests/try_finally_008.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Finally with jmp (do while)
+--FILE--
+
+--EXPECTF--
+Fatal error: jump out of a finally block is disallowed in 
%stry_finally_008.php on line %d
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index bad9411..6a501f7 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -2277,30 +2277,6 @@ void zend_resolve_goto_label(zend_op_array *op_array, 
zend_op *opline, int pass2
zval_dtor(label);
Z_TYPE_P(label) = IS_NULL;
 
-   if (op_array->last_try_catch) {
-   zend_uint i, op_num = opline - op_array->opcodes;
-   for (i=0; ilast_try_catch; i++) {
-   if (op_array->try_catch_array[i].try_op > op_num) {
-   break;
-   }
-   if (op_num >= op_array->try_catch_array[i].finally_op) {
-   zend_op *p, *end; 
-   p = opline;
-   end = op_array->opcodes + 
opline->op1.opline_num;
-   while (++p < end) {
-   if (p->opcode == ZEND_LEAVE) {
-   if (pass2) {
-   CG(in_compilation) = 1;
-   CG(active_op_array) = 
op_array;
-   CG(zend_lineno) = 
opline->lineno;
-   }
-   zend_error(E_COMPILE_ERROR, 
"'goto' out of a finally block is disallowed");
-   }
-   }
-   }
-   }
-   }
-
/* Check that we are not moving into loop or switch */
current = opline->extended_value;
for (distance = 0; current != dest->brk_cont; distance++) {
@@ -2686,6 +2662,7 @@ static int zend_add_try_element(zend_uint try_op 
TSRMLS_DC) /* {{{ */
CG(active_op_array)->try_catch_array = 
erealloc(CG(active_op_array)->try_catch_array, 
sizeof(zend_try_catch_element)*CG(active_op_array)->last_try_catch);
CG(active_op_array)->try_catch_array[try_catch_offset].try_op = try_op;
CG(active_op_array)->try_catch_array[try_catch_offset].finally_op = 0;
+   CG(active_op_array)->try_catch_array[try_catch_offset].finally_end = 0;
return try_catch_offset;
 }
 /* }}} */
@@ -2808,14 +2785,13 @@ void zend_do_bind_catch(znode *try_token, znode 
*catch_token TSRMLS_DC) /* {{{ *
 
 void zend_do_end_finally(znode *try_token, znode* catch_token, znode 
*finally_token TSRMLS_DC) /* {{{ */
 {
-   zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
-
if (catch_token->op_type == IS_UNUSED && finally_token->op_type == 
IS_UNUSED) {
zend_error(E_COMPILE_ERROR, "Cannot use try without catch or 
finally");
} 
if (finally_token->op_type != IS_UNUSED) {
+   zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);

CG(active_op_array)->try_catch_array[try_token->u.op.opline_num

[PHP-CVS] com php-src: Update version numbers to 5.4.7-dev.: configure.in main/php_version.h

2012-08-17 Thread Adam Harvey
Commit:14847af41d153e3abe4986afa49526d93810098a
Author:Adam Harvey  Fri, 17 Aug 2012 23:07:54 +0800
Parents:   0b23da1c74c52a819b728c78c66c182511223355
Branches:  PHP-5.4

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=14847af41d153e3abe4986afa49526d93810098a

Log:
Update version numbers to 5.4.7-dev.

Changed paths:
  M  configure.in
  M  main/php_version.h


Diff:
diff --git a/configure.in b/configure.in
index 1e80689..e5e1cd6 100644
--- a/configure.in
+++ b/configure.in
@@ -119,7 +119,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
 
 PHP_MAJOR_VERSION=5
 PHP_MINOR_VERSION=4
-PHP_RELEASE_VERSION=5
+PHP_RELEASE_VERSION=7
 PHP_EXTRA_VERSION="-dev"
 
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
 PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 1 + [$]PHP_MINOR_VERSION \* 
100 + [$]PHP_RELEASE_VERSION`
diff --git a/main/php_version.h b/main/php_version.h
index 4b7709c..3315661 100644
--- a/main/php_version.h
+++ b/main/php_version.h
@@ -2,7 +2,7 @@
 /* edit configure.in to change version number */
 #define PHP_MAJOR_VERSION 5
 #define PHP_MINOR_VERSION 4
-#define PHP_RELEASE_VERSION 5
+#define PHP_RELEASE_VERSION 7
 #define PHP_EXTRA_VERSION "-dev"
-#define PHP_VERSION "5.4.5-dev"
-#define PHP_VERSION_ID 50405
+#define PHP_VERSION "5.4.7-dev"
+#define PHP_VERSION_ID 50407


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



[PHP-CVS] com php-src: Fixed context info in error message: Zend/zend_compile.c

2012-08-17 Thread Xinchen Hui
Commit:24493652382c985b13a9ed94aae5fffae16a6895
Author:Xinchen Hui  Fri, 17 Aug 2012 21:18:20 
+0800
Parents:   3d93c888117a3f4e00f2e6a228d134eb336de2c2
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=24493652382c985b13a9ed94aae5fffae16a6895

Log:
Fixed context info in error message

Changed paths:
  M  Zend/zend_compile.c


Diff:
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index d7ca6ea..bad9411 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -2289,6 +2289,11 @@ void zend_resolve_goto_label(zend_op_array *op_array, 
zend_op *opline, int pass2
end = op_array->opcodes + 
opline->op1.opline_num;
while (++p < end) {
if (p->opcode == ZEND_LEAVE) {
+   if (pass2) {
+   CG(in_compilation) = 1;
+   CG(active_op_array) = 
op_array;
+   CG(zend_lineno) = 
opline->lineno;
+   }
zend_error(E_COMPILE_ERROR, 
"'goto' out of a finally block is disallowed");
}
}


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.4': ext/standard/var_unserializer.c

2012-08-17 Thread Xinchen Hui
Commit:3d93c888117a3f4e00f2e6a228d134eb336de2c2
Author:Xinchen Hui  Fri, 17 Aug 2012 18:30:03 
+0800
Parents:   85c37d0113a0560410435126cb3032dd22a7 
0b23da1c74c52a819b728c78c66c182511223355
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=3d93c888117a3f4e00f2e6a228d134eb336de2c2

Log:
Merge branch 'PHP-5.4'

Changed paths:
  MM  ext/standard/var_unserializer.c


Diff:



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



[PHP-CVS] com php-src: Fixed bug #62836 (Seg fault or broken object references on unserialize()): NEWS ext/standard/tests/serialize/bug62836_1.phpt ext/standard/tests/serialize/bug62836_2.phpt ext/sta

2012-08-17 Thread Xinchen Hui
Commit:0b23da1c74c52a819b728c78c66c182511223355
Author:Xinchen Hui  Fri, 17 Aug 2012 18:28:32 
+0800
Parents:   8ac61a3e60329a10dfc85036ef46d78e53f8de95
Branches:  PHP-5.4

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=0b23da1c74c52a819b728c78c66c182511223355

Log:
Fixed bug #62836 (Seg fault or broken object references on unserialize())

Bugs:
https://bugs.php.net/62836

Changed paths:
  M  NEWS
  A  ext/standard/tests/serialize/bug62836_1.phpt
  A  ext/standard/tests/serialize/bug62836_2.phpt
  M  ext/standard/var_unserializer.c


Diff:
diff --git a/NEWS b/NEWS
index c7fb47f..1142a42 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,10 @@ PHP  
  NEWS
   . Fixed bug (segfault due to PS(mod_user_implemented) not be reseted 
 when close handler call exit). (Laruence)
 
+- Standard:
+  . Fixed bug #62836 (Seg fault or broken object references on unserialize()).
+(Laruence)
+
 
 ?? ??? 2012, PHP 5.4.6
 
diff --git a/ext/standard/tests/serialize/bug62836_1.phpt 
b/ext/standard/tests/serialize/bug62836_1.phpt
new file mode 100644
index 000..7291046
--- /dev/null
+++ b/ext/standard/tests/serialize/bug62836_1.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Bug #62836 (Seg fault or broken object references on unserialize())
+--FILE--
+
+--EXPECT--
+A Object
+(
+[b] => B Object
+(
+)
+
+[b1] => B Object
+(
+)
+
+[c] => B Object
+(
+)
+
+[c1] => B Object
+(
+)
+
+)
+okey
diff --git a/ext/standard/tests/serialize/bug62836_2.phpt 
b/ext/standard/tests/serialize/bug62836_2.phpt
new file mode 100644
index 000..0634b1d
--- /dev/null
+++ b/ext/standard/tests/serialize/bug62836_2.phpt
@@ -0,0 +1,37 @@
+--TEST--
+Bug #62836 (Seg fault or broken object references on unserialize())
+--FILE--
+
+--EXPECT--
+A Object
+(
+[b] => B Object
+(
+)
+
+[b1] => B Object
+(
+)
+
+[c] => B Object
+(
+)
+
+[c1] => B Object
+(
+)
+
+)
+okey
diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c
index e1ac636..2537c52 100644
--- a/ext/standard/var_unserializer.c
+++ b/ext/standard/var_unserializer.c
@@ -620,10 +620,13 @@ yy20:
 
do {
/* Try to find class directly */
+   BG(serialize_lock) = 1;
if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == 
SUCCESS) {
+   BG(serialize_lock) = 0;
ce = *pce;
break;
}
+   BG(serialize_lock) = 0;

/* Check for unserialize callback */
if ((PG(unserialize_callback_func) == NULL) || 
(PG(unserialize_callback_func)[0] == '\0')) {
@@ -638,7 +641,9 @@ yy20:
args[0] = &arg_func_name;
MAKE_STD_ZVAL(arg_func_name);
ZVAL_STRING(arg_func_name, class_name, 1);
+   BG(serialize_lock) = 1;
if (call_user_function_ex(CG(function_table), NULL, user_func, 
&retval_ptr, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) {
+   BG(serialize_lock) = 0;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "defined 
(%s) but not found", user_func->value.str.val);
incomplete_class = 1;
ce = PHP_IC_ENTRY;
@@ -646,6 +651,7 @@ yy20:
zval_ptr_dtor(&arg_func_name);
break;
}
+   BG(serialize_lock) = 0;
if (retval_ptr) {
zval_ptr_dtor(&retval_ptr);
}


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