Re: [PHP-CVS] svn: /php/php-src/trunk/ Zend/zend.c Zend/zend_compile.c Zend/zend_globals.h Zend/zend_language_scanner.c Zend/zend_language_scanner.h Zend/zend_language_scanner.l Zend/zend_language_sca

2011-01-24 Thread Dmitry Stogov

Hi Moriyoshi,

Sorry, but I'll have to revert your patches to make ext/mbstring work 
again. I'm going do it on Wednesday. Please respond if you are going to 
fix it your self.


Thanks. Dmitry.

On 01/13/2011 05:32 PM, Dmitry Stogov wrote:

Hi Moriyoshi,

I just came from long vacation and found most of the ext/mbstring
related tests failed. Looking into the problems I found a lot of places
where PHP crashes because of NULL pointer deference. Some other tests
produce incorrect output.

Have you tried to run make test with your patch?

Could you please fix the bugs you introduced or revert the patch.

I've attached a patch that fixes some of mbstring crashes.

Thanks. Dmitry.

On 12/19/2010 07:36 PM, Moriyoshi Koizumi wrote:

moriyoshi Sun, 19 Dec 2010 16:36:37 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=306453

Log:
* Refactor zend_multibyte facility.
Now mbstring.script_encoding is superseded by zend.script_encoding.

Changed paths:
changed paths exceeded maximum size






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



Re: [PHP-CVS] svn: /php/php-src/trunk/ Zend/zend.c Zend/zend_compile.c Zend/zend_globals.h Zend/zend_language_scanner.c Zend/zend_language_scanner.h Zend/zend_language_scanner.l Zend/zend_language_sca

2011-01-13 Thread Dmitry Stogov

Hi Moriyoshi,

I just came from long vacation and found most of the ext/mbstring 
related tests failed. Looking into the problems I found a lot of places 
where PHP crashes because of NULL pointer deference. Some other tests 
produce incorrect output.


Have you tried to run make test with your patch?

Could you please fix the bugs you introduced or revert the patch.

I've attached a patch that fixes some of mbstring crashes.

Thanks. Dmitry.

On 12/19/2010 07:36 PM, Moriyoshi Koizumi wrote:

moriyoshiSun, 19 Dec 2010 16:36:37 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=306453

Log:
* Refactor zend_multibyte facility.
   Now mbstring.script_encoding is superseded by zend.script_encoding.

Changed paths:
changed paths exceeded maximum size



Index: ext/mbstring/mbstring.c
===
--- ext/mbstring/mbstring.c	(revision 307402)
+++ ext/mbstring/mbstring.c	(working copy)
@@ -2025,7 +2025,7 @@
 		return;
 	}
 
-	encoding = MBSTRG(current_http_output_encoding);
+	encoding = MBSTRG(current_http_output_encoding) ? MBSTRG(current_http_output_encoding) : mbfl_encoding_pass;
 
  	/* start phase only */
  	if ((arg_status  PHP_OUTPUT_HANDLER_START) != 0) {
@@ -2086,7 +2086,7 @@
  	/* feed the string */
  	mbfl_string_init(string);
  	string.no_language = MBSTRG(language);
- 	string.no_encoding = MBSTRG(current_internal_encoding)-no_encoding;
+ 	string.no_encoding = MBSTRG(current_internal_encoding) ? MBSTRG(current_internal_encoding)-no_encoding : mbfl_no_encoding_pass;
  	string.val = (unsigned char *)arg_string;
  	string.len = arg_string_len;
  	mbfl_buffer_converter_feed(MBSTRG(outconv), string);
@@ -2123,7 +2123,7 @@
 
 	string.no_language = MBSTRG(language);
 	if (enc_name == NULL) {
-		string.no_encoding = MBSTRG(current_internal_encoding)-no_encoding;
+		string.no_encoding = MBSTRG(current_internal_encoding) ? MBSTRG(current_internal_encoding)-no_encoding : mbfl_no_encoding_pass;
 	} else {
 		string.no_encoding = mbfl_name2no_encoding(enc_name);
 		if (string.no_encoding == mbfl_no_encoding_invalid) {
@@ -2154,9 +2154,9 @@
 	mbfl_string_init(haystack);
 	mbfl_string_init(needle);
 	haystack.no_language = MBSTRG(language);
-	haystack.no_encoding = MBSTRG(current_internal_encoding)-no_encoding;
+	haystack.no_encoding = MBSTRG(current_internal_encoding) ? MBSTRG(current_internal_encoding)-no_encoding : mbfl_no_encoding_pass;
 	needle.no_language = MBSTRG(language);
-	needle.no_encoding = MBSTRG(current_internal_encoding)-no_encoding;
+	needle.no_encoding = MBSTRG(current_internal_encoding) ? MBSTRG(current_internal_encoding)-no_encoding : mbfl_no_encoding_pass;
 	offset = 0;
 
 	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ss|ls, (char **)haystack.val, haystack.len, (char **)needle.val, needle.len, offset, enc_name, enc_name_len) == FAILURE) {
@@ -2221,9 +2221,9 @@
 	mbfl_string_init(haystack);
 	mbfl_string_init(needle);
 	haystack.no_language = MBSTRG(language);
-	haystack.no_encoding = MBSTRG(current_internal_encoding)-no_encoding;
+	haystack.no_encoding = MBSTRG(current_internal_encoding) ? MBSTRG(current_internal_encoding)-no_encoding : mbfl_no_encoding_pass;
 	needle.no_language = MBSTRG(language);
-	needle.no_encoding = MBSTRG(current_internal_encoding)-no_encoding;
+	needle.no_encoding = MBSTRG(current_internal_encoding) ? MBSTRG(current_internal_encoding)-no_encoding : mbfl_no_encoding_pass;
 
 	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ss|Zs, (char **)haystack.val, haystack.len, (char **)needle.val, needle.len, zoffset, enc_name, enc_name_len) == FAILURE) {
 		RETURN_FALSE;
@@ -2310,7 +2310,7 @@
 	int n;
 	long offset;
 	mbfl_string haystack, needle;
-	const char *from_encoding = MBSTRG(current_internal_encoding)-mime_name;
+	const char *from_encoding = MBSTRG(current_internal_encoding) ? MBSTRG(current_internal_encoding)-mime_name : NULL;
 	int from_encoding_len;
 	n = -1;
 	offset = 0;
@@ -2339,7 +2339,7 @@
 	int n;
 	long offset;
 	mbfl_string haystack, needle;
-	const char *from_encoding = MBSTRG(current_internal_encoding)-mime_name;
+	const char *from_encoding = MBSTRG(current_internal_encoding) ? MBSTRG(current_internal_encoding)-mime_name : NULL;
 	int from_encoding_len;
 	n = -1;
 	offset = 0;
@@ -2371,9 +2371,9 @@
 	mbfl_string_init(haystack);
 	mbfl_string_init(needle);
 	haystack.no_language = MBSTRG(language);
-	haystack.no_encoding = MBSTRG(current_internal_encoding)-no_encoding;
+	haystack.no_encoding = MBSTRG(current_internal_encoding) ? MBSTRG(current_internal_encoding)-no_encoding : mbfl_no_encoding_pass;
 	needle.no_language = MBSTRG(language);
-	needle.no_encoding = MBSTRG(current_internal_encoding)-no_encoding;
+	needle.no_encoding = MBSTRG(current_internal_encoding) ? MBSTRG(current_internal_encoding)-no_encoding : mbfl_no_encoding_pass;
 
 	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ss|bs, (char **)haystack.val, (int *)haystack.len, (char 

[PHP-CVS] svn: /php/php-src/trunk/Zend/ zend.c

2010-12-27 Thread Antony Dovgal
tony2001 Mon, 27 Dec 2010 20:25:34 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=306761

Log:
initialize script_encoding_list (reported by Gustavo Lopes)

Changed paths:
U   php/php-src/trunk/Zend/zend.c

Modified: php/php-src/trunk/Zend/zend.c
===
--- php/php-src/trunk/Zend/zend.c   2010-12-27 19:00:13 UTC (rev 306760)
+++ php/php-src/trunk/Zend/zend.c   2010-12-27 20:25:34 UTC (rev 306761)
@@ -522,6 +522,7 @@
} else {
compiler_globals-static_members_table = NULL;
}
+   compiler_globals-script_encoding_list = NULL;
 }
 /* }}} */


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

Re: [PHP-CVS] svn: /php/php-src/trunk/ Zend/zend.c Zend/zend_compile.c Zend/zend_globals.h Zend/zend_language_scanner.c Zend/zend_language_scanner.h Zend/zend_language_scanner.l Zend/zend_language_sca

2010-12-22 Thread Moriyoshi Koizumi
Okay, I'm gonna take a look into it.  Thanks.

Moriyoshi

On Tue, Dec 21, 2010 at 10:39 PM, Antony Dovgal t...@daylessday.org wrote:
 To reproduce, use the following configure line:
 ./configure --enable-exif

 On 12/21/2010 12:34 PM, Antony Dovgal wrote:
 ext/exif doesn't compile after this patch because of this:

 ext/exif/exif.o: In function `OnUpdateEncode':
 /local/qa/HEAD_non-ZTS/ext/exif/exif.c:169: undefined reference to 
 `zend_multibyte_check_encoding_list'
 ext/exif/exif.o: In function `OnUpdateDecode':
 /local/qa/HEAD_non-ZTS/ext/exif/exif.c:178: undefined reference to 
 `zend_multibyte_check_encoding_list'

 And if I change the code to use zend_multibyte_fetch_encoding(), the error 
 messages are back:
 ./sapi/cli/php -v
 PHP Warning:  PHP Startup: Illegal encoding ignored: 'ISO-8859-15' in 
 Unknown on line 0
 PHP Warning:  PHP Startup: Illegal encoding ignored: 'UCS-2BE' in Unknown on 
 line 0
 PHP Warning:  PHP Startup: Illegal encoding ignored: 'UCS-2LE' in Unknown on 
 line 0
 PHP Warning:  PHP Startup: Illegal encoding ignored: 'JIS' in Unknown on 
 line 0
 PHP Warning:  PHP Startup: Illegal encoding ignored: 'JIS' in Unknown on 
 line 0
 PHP 5.3.99-dev (cli) (built: Dec 21 2010 00:21:28) (DEBUG)
 Copyright (c) 1997-2010 The PHP Group
 Zend Engine v2.4.0, Copyright (c) 1998-2010 Zend Technologies

 --
 Wbr,
 Antony Dovgal
 ---
 http://pinba.org - realtime statistics for PHP


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



Re: [PHP-CVS] svn: /php/php-src/trunk/ Zend/zend.c Zend/zend_compile.c Zend/zend_globals.h Zend/zend_language_scanner.c Zend/zend_language_scanner.h Zend/zend_language_scanner.l Zend/zend_language_sca

2010-12-21 Thread Antony Dovgal
ext/exif doesn't compile after this patch because of this:

ext/exif/exif.o: In function `OnUpdateEncode':
/local/qa/HEAD_non-ZTS/ext/exif/exif.c:169: undefined reference to 
`zend_multibyte_check_encoding_list'
ext/exif/exif.o: In function `OnUpdateDecode':
/local/qa/HEAD_non-ZTS/ext/exif/exif.c:178: undefined reference to 
`zend_multibyte_check_encoding_list'

And if I change the code to use zend_multibyte_fetch_encoding(), the error 
messages are back:
./sapi/cli/php -v
PHP Warning:  PHP Startup: Illegal encoding ignored: 'ISO-8859-15' in Unknown 
on line 0
PHP Warning:  PHP Startup: Illegal encoding ignored: 'UCS-2BE' in Unknown on 
line 0
PHP Warning:  PHP Startup: Illegal encoding ignored: 'UCS-2LE' in Unknown on 
line 0
PHP Warning:  PHP Startup: Illegal encoding ignored: 'JIS' in Unknown on line 0
PHP Warning:  PHP Startup: Illegal encoding ignored: 'JIS' in Unknown on line 0
PHP 5.3.99-dev (cli) (built: Dec 21 2010 00:21:28) (DEBUG)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2010 Zend Technologies


On 12/19/2010 07:36 PM, Moriyoshi Koizumi wrote:
 moriyoshiSun, 19 Dec 2010 16:36:37 +
 
 Revision: http://svn.php.net/viewvc?view=revisionrevision=306453
 
 Log:
 * Refactor zend_multibyte facility.
   Now mbstring.script_encoding is superseded by zend.script_encoding.
 
 Changed paths:
 changed paths exceeded maximum size
 



-- 
Wbr,
Antony Dovgal
---
http://pinba.org - realtime statistics for PHP

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



Re: [PHP-CVS] svn: /php/php-src/trunk/ Zend/zend.c Zend/zend_compile.c Zend/zend_globals.h Zend/zend_language_scanner.c Zend/zend_language_scanner.h Zend/zend_language_scanner.l Zend/zend_language_sca

2010-12-21 Thread Antony Dovgal
To reproduce, use the following configure line:
./configure --enable-exif

On 12/21/2010 12:34 PM, Antony Dovgal wrote:
 ext/exif doesn't compile after this patch because of this:
 
 ext/exif/exif.o: In function `OnUpdateEncode':
 /local/qa/HEAD_non-ZTS/ext/exif/exif.c:169: undefined reference to 
 `zend_multibyte_check_encoding_list'
 ext/exif/exif.o: In function `OnUpdateDecode':
 /local/qa/HEAD_non-ZTS/ext/exif/exif.c:178: undefined reference to 
 `zend_multibyte_check_encoding_list'
 
 And if I change the code to use zend_multibyte_fetch_encoding(), the error 
 messages are back:
 ./sapi/cli/php -v
 PHP Warning:  PHP Startup: Illegal encoding ignored: 'ISO-8859-15' in Unknown 
 on line 0
 PHP Warning:  PHP Startup: Illegal encoding ignored: 'UCS-2BE' in Unknown on 
 line 0
 PHP Warning:  PHP Startup: Illegal encoding ignored: 'UCS-2LE' in Unknown on 
 line 0
 PHP Warning:  PHP Startup: Illegal encoding ignored: 'JIS' in Unknown on line  0
 PHP Warning:  PHP Startup: Illegal encoding ignored: 'JIS' in Unknown on line  0
 PHP 5.3.99-dev (cli) (built: Dec 21 2010 00:21:28) (DEBUG)
 Copyright (c) 1997-2010 The PHP Group
 Zend Engine v2.4.0, Copyright (c) 1998-2010 Zend Technologies

-- 
Wbr,
Antony Dovgal
---
http://pinba.org - realtime statistics for PHP

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



Re: [PHP-CVS] svn: /php/php-src/trunk/ Zend/zend.c Zend/zend_compile.c Zend/zend_globals.h Zend/zend_language_scanner.c Zend/zend_language_scanner.h Zend/zend_language_scanner.l Zend/zend_language_sca

2010-12-21 Thread Pierre Joye
confirmed on windows too:

http://rmtools.php.net/snaps/trunk-ts-windows-vc9-x86/logs/r306535/compile.txt

Cheers,

On Tue, Dec 21, 2010 at 2:39 PM, Antony Dovgal t...@daylessday.org wrote:
 To reproduce, use the following configure line:
 ./configure --enable-exif

 On 12/21/2010 12:34 PM, Antony Dovgal wrote:
 ext/exif doesn't compile after this patch because of this:

 ext/exif/exif.o: In function `OnUpdateEncode':
 /local/qa/HEAD_non-ZTS/ext/exif/exif.c:169: undefined reference to 
 `zend_multibyte_check_encoding_list'
 ext/exif/exif.o: In function `OnUpdateDecode':
 /local/qa/HEAD_non-ZTS/ext/exif/exif.c:178: undefined reference to 
 `zend_multibyte_check_encoding_list'

 And if I change the code to use zend_multibyte_fetch_encoding(), the error 
 messages are back:
 ./sapi/cli/php -v
 PHP Warning:  PHP Startup: Illegal encoding ignored: 'ISO-8859-15' in 
 Unknown on line 0
 PHP Warning:  PHP Startup: Illegal encoding ignored: 'UCS-2BE' in Unknown on 
 line 0
 PHP Warning:  PHP Startup: Illegal encoding ignored: 'UCS-2LE' in Unknown on 
 line 0
 PHP Warning:  PHP Startup: Illegal encoding ignored: 'JIS' in Unknown on 
 line 0
 PHP Warning:  PHP Startup: Illegal encoding ignored: 'JIS' in Unknown on 
 line 0
 PHP 5.3.99-dev (cli) (built: Dec 21 2010 00:21:28) (DEBUG)
 Copyright (c) 1997-2010 The PHP Group
 Zend Engine v2.4.0, Copyright (c) 1998-2010 Zend Technologies

 --
 Wbr,
 Antony Dovgal
 ---
 http://pinba.org - realtime statistics for PHP

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





-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org

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



[PHP-CVS] svn: /php/php-src/trunk/Zend/ zend.c

2010-09-21 Thread Felipe Pena
felipe   Wed, 22 Sep 2010 00:11:34 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=303653

Log:
- Fixed EG(saved_fpu_cw) initialization

Changed paths:
U   php/php-src/trunk/Zend/zend.c

Modified: php/php-src/trunk/Zend/zend.c
===
--- php/php-src/trunk/Zend/zend.c   2010-09-21 23:40:39 UTC (rev 303652)
+++ php/php-src/trunk/Zend/zend.c   2010-09-22 00:11:34 UTC (rev 303653)
@@ -547,7 +547,9 @@
EG(current_execute_data) = NULL;
EG(current_module) = NULL;
EG(exit_status) = 0;
-   EG(saved_fpu_cw) = NULL;
+#if XPFPA_HAVE_CW
+   EG(saved_fpu_cw) = 0;
+#endif
EG(saved_fpu_cw_ptr) = NULL;
EG(active) = 0;
 }

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

[PHP-CVS] svn: /php/php-src/trunk/Zend/ zend.c

2010-07-10 Thread Felipe Pena
felipe   Sat, 10 Jul 2010 13:56:33 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=301152

Log:
- Added EG(saved_fpu_cw_ptr) initialization

Changed paths:
U   php/php-src/trunk/Zend/zend.c

Modified: php/php-src/trunk/Zend/zend.c
===
--- php/php-src/trunk/Zend/zend.c   2010-07-10 12:39:02 UTC (rev 301151)
+++ php/php-src/trunk/Zend/zend.c   2010-07-10 13:56:33 UTC (rev 301152)
@@ -548,6 +548,7 @@
EG(current_module) = NULL;
EG(exit_status) = 0;
EG(saved_fpu_cw) = NULL;
+   EG(saved_fpu_cw_ptr) = NULL;
EG(active) = 0;
 }
 /* }}} */

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

[PHP-CVS] svn: /php/php-src/trunk/ Zend/zend.c Zend/zend_API.c Zend/zend_API.h Zend/zend_compile.c Zend/zend_globals.h Zend/zend_opcode.c ext/reflection/php_reflection.c

2010-05-24 Thread Dmitry Stogov
dmitry   Mon, 24 May 2010 17:07:52 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=299702

Log:
Fixed ZTS build

Changed paths:
U   php/php-src/trunk/Zend/zend.c
U   php/php-src/trunk/Zend/zend_API.c
U   php/php-src/trunk/Zend/zend_API.h
U   php/php-src/trunk/Zend/zend_compile.c
U   php/php-src/trunk/Zend/zend_globals.h
U   php/php-src/trunk/Zend/zend_opcode.c
U   php/php-src/trunk/ext/reflection/php_reflection.c

Modified: php/php-src/trunk/Zend/zend.c
===
--- php/php-src/trunk/Zend/zend.c   2010-05-24 17:06:09 UTC (rev 299701)
+++ php/php-src/trunk/Zend/zend.c   2010-05-24 17:07:52 UTC (rev 299702)
@@ -505,9 +505,9 @@

compiler_globals-last_static_member = 
zend_hash_num_elements(compiler_globals-class_table);
if (compiler_globals-last_static_member) {
-   compiler_globals-static_members = 
(HashTable**)calloc(compiler_globals-last_static_member, sizeof(HashTable*));
+   compiler_globals-static_members_table = 
calloc(compiler_globals-last_static_member, sizeof(zval**));
} else {
-   compiler_globals-static_members = NULL;
+   compiler_globals-static_members_table = NULL;
}
 }
 /* }}} */
@@ -526,8 +526,8 @@
zend_hash_destroy(compiler_globals-auto_globals);
free(compiler_globals-auto_globals);
}
-   if (compiler_globals-static_members) {
-   free(compiler_globals-static_members);
+   if (compiler_globals-static_members_table) {
+   free(compiler_globals-static_members_table);
}
compiler_globals-last_static_member = 0;
 }

Modified: php/php-src/trunk/Zend/zend_API.c
===
--- php/php-src/trunk/Zend/zend_API.c   2010-05-24 17:06:09 UTC (rev 299701)
+++ php/php-src/trunk/Zend/zend_API.c   2010-05-24 17:07:52 UTC (rev 299702)
@@ -1026,7 +1026,7 @@
zend_update_class_constants(class_type-parent 
TSRMLS_CC);
}
 #if ZTS
-   
CG(static_members)[(zend_intptr_t)(class_type-static_members)] = 
emalloc(sizeof(zval*) * class_type-default_static_members_count);
+   
CG(static_members_table)[(zend_intptr_t)(class_type-static_members_table)] = 
emalloc(sizeof(zval*) * class_type-default_static_members_count);
 #else
class_type-static_members_table = 
emalloc(sizeof(zval*) * class_type-default_static_members_count);
 #endif

Modified: php/php-src/trunk/Zend/zend_API.h
===
--- php/php-src/trunk/Zend/zend_API.h   2010-05-24 17:06:09 UTC (rev 299701)
+++ php/php-src/trunk/Zend/zend_API.h   2010-05-24 17:07:52 UTC (rev 299702)
@@ -208,7 +208,7 @@
INIT_OVERLOADED_CLASS_ENTRY(class_container, ZEND_NS_NAME(ns, 
class_name), functions, handle_fcall, handle_propget, handle_propset)

 #ifdef ZTS
-#  define CE_STATIC_MEMBERS(ce) 
(((ce)-type==ZEND_USER_CLASS)?(ce)-static_members:CG(static_members_table)[(zend_intptr_t)(ce)-static_members_table])
+#  define CE_STATIC_MEMBERS(ce) 
(((ce)-type==ZEND_USER_CLASS)?(ce)-static_members_table:CG(static_members_table)[(zend_intptr_t)(ce)-static_members_table])
 #else
 #  define CE_STATIC_MEMBERS(ce) ((ce)-static_members_table)
 #endif

Modified: php/php-src/trunk/Zend/zend_compile.c
===
--- php/php-src/trunk/Zend/zend_compile.c   2010-05-24 17:06:09 UTC (rev 
299701)
+++ php/php-src/trunk/Zend/zend_compile.c   2010-05-24 17:07:52 UTC (rev 
299702)
@@ -6140,18 +6140,18 @@
 #ifdef ZTS
int n = zend_hash_num_elements(CG(class_table));

-   if (CG(static_members)  n = CG(last_static_member)) {
+   if (CG(static_members_table)  n = CG(last_static_member)) {
/* Support for run-time declaration: dl() */
CG(last_static_member) = n+1;
-   CG(static_members) = realloc(CG(static_members), 
(n+1)*sizeof(HashTable*));
-   CG(static_members)[n] = NULL;
+   CG(static_members_table) = 
realloc(CG(static_members_table), (n+1)*sizeof(zval**));
+   CG(static_members_table)[n] = NULL;
}
ce-static_members_table = (zval**)(zend_intptr_t)n;
 #else
ce-static_members_table = NULL;
 #endif
} else {
-   ce-static_members_table = ce-default_static_members_table;
+   ce-static_members_table = ce-default_static_members_table;
}

ce-default_properties_count = 0;

Modified: php/php-src/trunk/Zend/zend_globals.h
===
--- php/php-src/trunk/Zend/zend_globals.h  

[PHP-CVS] svn: /php/php-src/trunk/Zend/ zend.c

2010-04-25 Thread David Soria Parra
dsp  Sun, 25 Apr 2010 18:34:36 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298548

Log:
Remove unused variable

Changed paths:
U   php/php-src/trunk/Zend/zend.c

Modified: php/php-src/trunk/Zend/zend.c
===
--- php/php-src/trunk/Zend/zend.c   2010-04-25 18:31:38 UTC (rev 298547)
+++ php/php-src/trunk/Zend/zend.c   2010-04-25 18:34:36 UTC (rev 298548)
@@ -979,7 +979,6 @@
uint error_lineno;
zval *orig_user_error_handler;
zend_bool in_compilation;
-   char dtrace_error_buffer[1024];
zend_class_entry *saved_class_entry;
TSRMLS_FETCH();


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

[PHP-CVS] svn: php/php-src/trunk/Zend/ zend.c

2009-07-20 Thread David Soria Parra
dsp Mon, 20 Jul 2009 10:12:12 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=284423

Changed paths:
U   php/php-src/trunk/Zend/zend.c

Log:
- Fix overflow and use our internal vssprintf implementation

Modified: php/php-src/trunk/Zend/zend.c
===
--- php/php-src/trunk/Zend/zend.c   2009-07-20 09:52:54 UTC (rev 284422)
+++ php/php-src/trunk/Zend/zend.c   2009-07-20 10:12:12 UTC (rev 284423)
@@ -1546,7 +1546,6 @@
zval *orig_user_error_handler;
zend_bool in_compilation;
zend_class_entry *saved_class_entry;
-   char dtrace_error_buffer[1024];
TSRMLS_FETCH();

/* Obtain relevant filename and lineno */
@@ -1592,9 +1591,11 @@
va_start(args, format);

if(DTRACE_ERROR_ENABLED()) {
-   vsprintf(dtrace_error_buffer, format, args);
+   char *dtrace_error_buffer;
+   zend_vspprintf(dtrace_error_buffer, 0, format, args);
+   DTRACE_ERROR(dtrace_error_buffer, error_filename, error_lineno);
+   efree(dtrace_error_buffer);
}
-   DTRACE_ERROR(dtrace_error_buffer, error_filename, error_lineno);


/* if we don't have a user defined error handler */

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

[PHP-CVS] svn: php/php-src/trunk/ Zend/zend.c Zend/zend_dtrace.c Zend/zend_dtrace.h Zend/zend_exceptions.c Zend/zend_vm_def.h Zend/zend_vm_execute.h configure.in main/main.c

2009-07-20 Thread David Soria Parra
dsp Mon, 20 Jul 2009 10:12:34 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=284424

Changed paths:
U   php/php-src/trunk/Zend/zend.c
U   php/php-src/trunk/Zend/zend_dtrace.c
U   php/php-src/trunk/Zend/zend_dtrace.h
U   php/php-src/trunk/Zend/zend_exceptions.c
U   php/php-src/trunk/Zend/zend_vm_def.h
U   php/php-src/trunk/Zend/zend_vm_execute.h
U   php/php-src/trunk/configure.in
U   php/php-src/trunk/main/main.c

Log:
- Define HAVE_DTRACE if dtrace is available and ifdef all calls to dtrace probes

Modified: php/php-src/trunk/Zend/zend.c
===
--- php/php-src/trunk/Zend/zend.c   2009-07-20 10:12:12 UTC (rev 284423)
+++ php/php-src/trunk/Zend/zend.c   2009-07-20 10:12:34 UTC (rev 284424)
@@ -1590,12 +1590,14 @@

va_start(args, format);

+#ifdef HAVE_DTRACE
if(DTRACE_ERROR_ENABLED()) {
char *dtrace_error_buffer;
zend_vspprintf(dtrace_error_buffer, 0, format, args);
DTRACE_ERROR(dtrace_error_buffer, error_filename, error_lineno);
efree(dtrace_error_buffer);
}
+#endif /* HAVE_DTRACE */


/* if we don't have a user defined error handler */

Modified: php/php-src/trunk/Zend/zend_dtrace.c
===
--- php/php-src/trunk/Zend/zend_dtrace.c2009-07-20 10:12:12 UTC (rev 
284423)
+++ php/php-src/trunk/Zend/zend_dtrace.c2009-07-20 10:12:34 UTC (rev 
284424)
@@ -22,7 +22,7 @@
 #include zend_API.h
 #include zend_dtrace.h

-#ifdef HAVE_SYS_SDT_H
+#ifdef HAVE_DTRACE
 /* PHP DTrace probes {{{ */
 static inline char *dtrace_get_executed_filename(TSRMLS_D)
 {
@@ -118,5 +118,5 @@
 }

 /* }}} */
-#endif
+#endif /* HAVE_DTRACE */


Modified: php/php-src/trunk/Zend/zend_dtrace.h
===
--- php/php-src/trunk/Zend/zend_dtrace.h2009-07-20 10:12:12 UTC (rev 
284423)
+++ php/php-src/trunk/Zend/zend_dtrace.h2009-07-20 10:12:34 UTC (rev 
284424)
@@ -29,7 +29,7 @@
 extern C {
 #endif

-#ifdef HAVE_SYS_SDT_H
+#ifdef HAVE_DTRACE
 ZEND_API zend_op_array *(*zend_dtrace_compile_file)(zend_file_handle 
*file_handle, int type TSRMLS_DC);
 ZEND_API void (*zend_dtrace_execute)(zend_op_array *op_array TSRMLS_DC);
 ZEND_API void (*zend_dtrace_execute_internal)(zend_execute_data 
*execute_data_ptr, int return_value_used TSRMLS_DC);
@@ -39,33 +39,8 @@
 ZEND_API void dtrace_execute_internal(zend_execute_data *execute_data_ptr, int 
return_value_used TSRMLS_DC);
 #include zend_dtrace_gen.h

-#else
+#endif /* HAVE_DTRACE */

-#define DTRACE_COMPILE_FILE_ENTRY(arg0, arg1)
-#define DTRACE_COMPILE_FILE_ENTRY_ENABLED() (0)
-#define DTRACE_COMPILE_FILE_RETURN(arg0, arg1)
-#define DTRACE_COMPILE_FILE_RETURN_ENABLED() (0)
-#define DTRACE_ERROR(arg0, arg1, arg2)
-#define DTRACE_ERROR_ENABLED() (0)
-#define DTRACE_EXCEPTION_CAUGHT(arg0)
-#define DTRACE_EXCEPTION_CAUGHT_ENABLED() (0)
-#define DTRACE_EXCEPTION_THROWN(arg0)
-#define DTRACE_EXCEPTION_THROWN_ENABLED() (0)
-#define DTRACE_EXECUTE_ENTRY(arg0, arg1)
-#define DTRACE_EXECUTE_ENTRY_ENABLED() (0)
-#define DTRACE_EXECUTE_RETURN(arg0, arg1)
-#define DTRACE_EXECUTE_RETURN_ENABLED() (0)
-#define DTRACE_FUNCTION_ENTRY(arg0, arg1, arg2, arg3, arg4)
-#define DTRACE_FUNCTION_ENTRY_ENABLED() (0)
-#define DTRACE_FUNCTION_RETURN(arg0, arg1, arg2, arg3, arg4)
-#define DTRACE_FUNCTION_RETURN_ENABLED() (0)
-#define DTRACE_REQUEST_SHUTDOWN(arg0, arg1, arg2)
-#define DTRACE_REQUEST_SHUTDOWN_ENABLED() (0)
-#define DTRACE_REQUEST_STARTUP(arg0, arg1, arg2)
-#define DTRACE_REQUEST_STARTUP_ENABLED() (0)
-
-#endif /* HAVE_SYS_SDT */
-
 #ifdef __cplusplus
 }
 #endif

Modified: php/php-src/trunk/Zend/zend_exceptions.c
===
--- php/php-src/trunk/Zend/zend_exceptions.c2009-07-20 10:12:12 UTC (rev 
284423)
+++ php/php-src/trunk/Zend/zend_exceptions.c2009-07-20 10:12:34 UTC (rev 
284424)
@@ -83,6 +83,7 @@

 void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */
 {
+#ifdef HAVE_DTRACE
if (DTRACE_EXCEPTION_THROWN_ENABLED()) {
zstr classname;
char *s_classname;
@@ -97,6 +98,7 @@
efree(classname.v);
efree(s_classname);
}
+#endif /* HAVE_DTRACE */

if (exception != NULL) {
zval *previous = EG(exception);

Modified: php/php-src/trunk/Zend/zend_vm_def.h
===
--- php/php-src/trunk/Zend/zend_vm_def.h2009-07-20 10:12:12 UTC (rev 
284423)
+++ php/php-src/trunk/Zend/zend_vm_def.h2009-07-20 10:12:34 UTC (rev 
284424)
@@ -2627,6 +2627,7 @@
}
ce = Z_OBJCE_P(EG(exception));

+#ifdef HAVE_DTRACE
if (DTRACE_EXCEPTION_CAUGHT_ENABLED()) {
char 

Re: [PHP-CVS] svn: php/php-src/trunk/ Zend/zend.c Zend/zend_dtrace.c Zend/zend_dtrace.h Zend/zend_exceptions.c Zend/zend_vm_def.h Zend/zend_vm_execute.h configure.in main/main.c

2009-07-20 Thread Pierre Joye
On Mon, Jul 20, 2009 at 12:12 PM, David Soria Parrad...@php.net wrote:

 Log:
 - Define HAVE_DTRACE if dtrace is available and ifdef all calls to dtrace 
 probes

Thanks! :)

Cheers,
-- 
Pierre

http://blog.thepimp.net | http://www.libgd.org

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