]> granicus.if.org Git - php/commitdiff
PPC machines mark char as unsigned, rather than signed.
authorScott MacVicar <scottmac@php.net>
Fri, 8 May 2009 11:36:35 +0000 (11:36 +0000)
committerScott MacVicar <scottmac@php.net>
Fri, 8 May 2009 11:36:35 +0000 (11:36 +0000)
This caused a segfault when using the T type for zend_parse_parameters because the default value
ended up being 255 and never -1

Zend/zend_API.c

index 4ef402d9a28fa5192242c2c4e797a2032a69c271..7a3712c98a3c5f978c7eb5098377520e17f0d39f 100644 (file)
@@ -309,7 +309,7 @@ static int parse_arg_object_to_string(zval **arg, char **p, int *pl, int type TS
 }
 /* }}} */
 
-static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **spec, char T_arg_type, int* ret_type, char **error, int *severity TSRMLS_DC) /* {{{ */
+static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **spec, signed char T_arg_type, int* ret_type, char **error, int *severity TSRMLS_DC) /* {{{ */
 {
        char *spec_walk = *spec;
        char c = *spec_walk++;
@@ -843,7 +843,7 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **sp
 }
 /* }}} */
 
-static int zend_parse_arg(int arg_num, zval **arg, va_list *va, char **spec, int quiet, char T_arg_type TSRMLS_DC) /* {{{ */
+static int zend_parse_arg(int arg_num, zval **arg, va_list *va, char **spec, int quiet, signed char T_arg_type TSRMLS_DC) /* {{{ */
 {
        char *expected_type = NULL, *error = NULL;
        int ret_type = IS_STRING;
@@ -886,7 +886,7 @@ static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int fl
        int quiet = flags & ZEND_PARSE_PARAMS_QUIET;
        zend_bool have_varargs = 0;
        zend_bool T_present = 0;
-       char T_arg_type = -1;
+       signed char T_arg_type = -1;
        zval ****varargs = NULL;
        int *n_varargs = NULL;