stas Fri Mar 16 20:08:25 2007 UTC
Added files: (Branch: PHP_4_4)
/php-src/ext/standard/tests/array array_user_key_compare.phpt
Modified files:
/php-src/ext/standard array.c
Log:
Fix UMR in array_user_key_compare() (MOPB24 by Stefan Esser)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.199.2.44.2.15&r2=1.199.2.44.2.16&diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.199.2.44.2.15
php-src/ext/standard/array.c:1.199.2.44.2.16
--- php-src/ext/standard/array.c:1.199.2.44.2.15 Mon Jan 22 08:23:08 2007
+++ php-src/ext/standard/array.c Fri Mar 16 20:08:25 2007
@@ -22,7 +22,7 @@
*/
-/* $Id: array.c,v 1.199.2.44.2.15 2007/01/22 08:23:08 tony2001 Exp $ */
+/* $Id: array.c,v 1.199.2.44.2.16 2007/03/16 20:08:25 stas Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -626,40 +626,40 @@
{
Bucket *f;
Bucket *s;
- pval key1, key2;
- pval *args[2];
- pval retval;
+ zval *key1, *key2;
+ zval *args[2];
+ zval retval;
int status;
- args[0] = &key1;
- args[1] = &key2;
- INIT_PZVAL(&key1);
- INIT_PZVAL(&key2);
+ ALLOC_INIT_ZVAL(key1);
+ ALLOC_INIT_ZVAL(key2);
+ args[0] = key1;
+ args[1] = key2;
f = *((Bucket **) a);
s = *((Bucket **) b);
if (f->nKeyLength) {
- Z_STRVAL(key1) = estrndup(f->arKey, f->nKeyLength-1);
- Z_STRLEN(key1) = f->nKeyLength-1;
- Z_TYPE(key1) = IS_STRING;
+ Z_STRVAL_P(key1) = estrndup(f->arKey, f->nKeyLength-1);
+ Z_STRLEN_P(key1) = f->nKeyLength-1;
+ Z_TYPE_P(key1) = IS_STRING;
} else {
- Z_LVAL(key1) = f->h;
- Z_TYPE(key1) = IS_LONG;
+ Z_LVAL_P(key1) = f->h;
+ Z_TYPE_P(key1) = IS_LONG;
}
if (s->nKeyLength) {
- Z_STRVAL(key2) = estrndup(s->arKey, s->nKeyLength-1);
- Z_STRLEN(key2) = s->nKeyLength-1;
- Z_TYPE(key2) = IS_STRING;
+ Z_STRVAL_P(key2) = estrndup(s->arKey, s->nKeyLength-1);
+ Z_STRLEN_P(key2) = s->nKeyLength-1;
+ Z_TYPE_P(key2) = IS_STRING;
} else {
- Z_LVAL(key2) = s->h;
- Z_TYPE(key2) = IS_LONG;
+ Z_LVAL_P(key2) = s->h;
+ Z_TYPE_P(key2) = IS_LONG;
}
status = call_user_function(EG(function_table), NULL,
*BG(user_compare_func_name), &retval, 2, args TSRMLS_CC);
- zval_dtor(&key1);
- zval_dtor(&key2);
+ zval_ptr_dtor(&key1);
+ zval_ptr_dtor(&key2);
if (status == SUCCESS) {
convert_to_long(&retval);
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_user_key_compare.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/array/array_user_key_compare.phpt
+++ php-src/ext/standard/tests/array/array_user_key_compare.phpt
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php