]> granicus.if.org Git - php/commitdiff
Merge branch 'master' into phpng
authorXinchen Hui <laruence@php.net>
Sun, 1 Jun 2014 14:29:41 +0000 (22:29 +0800)
committerXinchen Hui <laruence@php.net>
Sun, 1 Jun 2014 14:43:06 +0000 (22:43 +0800)
Conflicts:
ext/spl/spl_array.c
ext/spl/spl_directory.c
ext/standard/formatted_print.c

1  2 
ext/spl/spl_iterators.c
ext/standard/formatted_print.c

index 7900b4b5b2d17f1cccc57a3ec5c96ee9416e8513,b9901f8f27c7eb750b048a3b684a85c383dfc775..9e1820ccac19ce08b2837b817a125bd11ae261d8
@@@ -836,17 -837,19 +836,19 @@@ static union _zend_function *spl_recurs
        zval                    *zobj;
  
        if (!object->iterators) {
 -              php_error_docref(NULL TSRMLS_CC, E_ERROR, "The %s instance wasn't initialized properly", Z_OBJCE_PP(object_ptr)->name);
 +              php_error_docref(NULL TSRMLS_CC, E_ERROR, "The %s instance wasn't initialized properly", zend_get_class_entry(*zobject TSRMLS_CC)->name->val);
        }
 -      zobj = object->iterators[level].zobject;
 +      zobj = &object->iterators[level].zobject;
  
 -      function_handler = std_object_handlers.get_method(object_ptr, method, method_len, key TSRMLS_CC);
 +      function_handler = std_object_handlers.get_method(zobject, method, key TSRMLS_CC);
        if (!function_handler) {
 -              if (zend_hash_find(&Z_OBJCE_P(zobj)->function_table, method, method_len+1, (void **) &function_handler) == FAILURE) {
 +              if ((function_handler = zend_hash_find_ptr(&Z_OBJCE_P(zobj)->function_table, method)) == NULL) {
                        if (Z_OBJ_HT_P(zobj)->get_method) {
 -                              *object_ptr = zobj;
 -                              function_handler = Z_OBJ_HT_P(*object_ptr)->get_method(object_ptr, method, method_len, key TSRMLS_CC);
 +                              *zobject = Z_OBJ_P(zobj);
 +                              function_handler = (*zobject)->handlers->get_method(zobject, method, key TSRMLS_CC);
                        }
 -                      *object_ptr = zobj;
+               } else {
++                      *zobject = Z_OBJ_P(zobj);
                }
        }
        return function_handler;
index 2942daaad3ec04eb95c7e08e05435219fe19f619,2592b1655dc8f75470384d43c935a89fac251b63..6c1f157cec9b6c28fd5089aa79b824eaa0ed64d1
@@@ -368,16 -368,15 +368,17 @@@ php_sprintf_getnumber(char *buffer, in
   *  "X"   integer argument is printed as uppercase hexadecimal
   *
   */
 -static char *
 -php_formatted_print(int ht, int *len, int use_array, int format_offset TSRMLS_DC)
 +static zend_string *
 +php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC)
  {
 -      zval ***args, **z_format;
 +      zval *newargs = NULL;
 +      zval *args, *z_format;
        int argc, size = 240, inpos = 0, outpos = 0, temppos;
        int alignment, currarg, adjusting, argnum, width, precision;
 -      char *format, *result, padding;
 +      char *format, padding;
 +      zend_string *result;
        int always_sign;
+       int format_len;
  
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) {
                return NULL;