com php-src: fixes to zend: Zend/zend.c Zend/zend.h Zend/zend_execute.h Zend/zend_operators.h
| From: | Anatol Belski | Date: | Wed, 16 Oct 2013 09:35:31 +0000 |
| Subject: | com php-src: fixes to zend: Zend/zend.c Zend/zend.h Zend/zend_execute.h Zend/zend_operators.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-73504@lists.php.net to get a copy of this message | ||
Commit: baf3937c37b6fccbf8b7d4dad87bc221b3056699
Author: Anatol Belski <ab@php.net> Wed, 17 Jul 2013 09:11:51 -0700
Parents: 0e3420bf8f9152050df81d30f1bbc4af14512d58
Branches: str_size_and_int64
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=baf3937c37b6fccbf8b7d4dad87bc221b3056699
Log:
fixes to zend
Changed paths:
M Zend/zend.c
M Zend/zend.h
M Zend/zend_execute.h
M Zend/zend_operators.h
Diff:
diff --git a/Zend/zend.c b/Zend/zend.c
index 116eb97..28ce67e 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -311,13 +311,13 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int
*use_cop
}
/* }}} */
-ZEND_API int zend_print_zval(zval *expr, int indent) /* {{{ */
+ZEND_API zend_str_size_int zend_print_zval(zval *expr, int indent) /* {{{ */
{
return zend_print_zval_ex(zend_write, expr, indent);
}
/* }}} */
-ZEND_API int zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int indent) /* {{{ */
+ZEND_API zend_str_size_int zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int indent)
/* {{{ */
{
zval expr_copy;
int use_copy;
diff --git a/Zend/zend.h b/Zend/zend.h
index 9425bcc..524b5eb 100644
--- a/Zend/zend.h
+++ b/Zend/zend.h
@@ -558,11 +558,11 @@ typedef struct _zend_utility_functions {
typedef struct _zend_utility_values {
char *import_use_extension;
- uint import_use_extension_length;
+ zend_str_size_uint import_use_extension_length;
zend_bool html_errors;
} zend_utility_values;
-typedef int (*zend_write_func_t)(const char *str, uint str_length);
+typedef int (*zend_write_func_t)(const char *str, zend_str_size_uint str_length);
#undef MIN
#undef MAX
@@ -643,8 +643,8 @@ END_EXTERN_C()
BEGIN_EXTERN_C()
ZEND_API char *get_zend_version(void);
ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_copy);
-ZEND_API int zend_print_zval(zval *expr, int indent);
-ZEND_API int zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int indent);
+ZEND_API zend_str_size_int zend_print_zval(zval *expr, int indent);
+ZEND_API zend_str_size_int zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int
indent);
ZEND_API void zend_print_zval_r(zval *expr, int indent TSRMLS_DC);
ZEND_API void zend_print_flat_zval_r(zval *expr TSRMLS_DC);
ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int indent TSRMLS_DC);
diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h
index 9d747e6..5101f3d 100644
--- a/Zend/zend_execute.h
+++ b/Zend/zend_execute.h
@@ -194,7 +194,7 @@ static zend_always_inline void zend_vm_stack_destroy(TSRMLS_D)
}
}
-static zend_always_inline void zend_vm_stack_extend(int count TSRMLS_DC)
+static zend_always_inline void zend_vm_stack_extend(size_t count TSRMLS_DC)
{
zend_vm_stack p = zend_vm_stack_new_page(count >= ZEND_VM_STACK_PAGE_SIZE ? count :
ZEND_VM_STACK_PAGE_SIZE);
p->prev = EG(argument_stack);
diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h
index 432a186..597aa5e 100644
--- a/Zend/zend_operators.h
+++ b/Zend/zend_operators.h
@@ -274,12 +274,16 @@ zend_memnstr(const char *haystack, const char *needle, zend_str_size_int
needle_
{
const char *p = haystack;
const char ne = needle[needle_len-1];
+ ptrdiff_t off_p;
+ zend_str_size_int off_s;
if (needle_len == 1) {
return (char *)memchr(p, *needle, (end-p));
}
- if (needle_len > end-haystack) {
+ off_p = end - haystack;
+ off_s = (off_p > 0) ? (zend_str_size_int)off_p : 0;
+ if (needle_len > off_s) {
return NULL;
}