com php-src: Use memcmp() instead of strncmp(): Zend/zend_vm _def.h Zend/zend_vm_execute.h ext/standard/type .c

From: Date: Mon, 16 Mar 2015 12:53:54 +0000
Subject: com php-src: Use memcmp() instead of strncmp(): Zend/zend_vm _def.h Zend/zend_vm_execute.h ext/standard/type .c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-85527@lists.php.net to get a copy of this message
Commit: 0a6ab089cd28b3ef4504777c0122d788a827b54f Author: Dmitry Stogov <dmitry@zend.com> Mon, 16 Mar 2015 15:53:54 +0300 Parents: eeb8eced9b84cec85ae5652d0fe461bb2a7b3278 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0a6ab089cd28b3ef4504777c0122d788a827b54f Log: Use memcmp() instead of strncmp() Changed paths: M Zend/zend_vm_def.h M Zend/zend_vm_execute.h M ext/standard/type.c Diff: diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index ba5619f..d7cf7ad 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -6936,7 +6936,7 @@ ZEND_VM_HANDLER(123, ZEND_TYPE_CHECK, CONST|TMP|VAR|CV, ANY) if (Z_TYPE_P(value) == opline->extended_value) { zend_class_entry *ce = Z_OBJCE_P(value); if (ce->name->len == sizeof("__PHP_Incomplete_Class") - 1 - && !strncmp(ce->name->val, "__PHP_Incomplete_Class", ce->name->len)) { + && !memcmp(ce->name->val, "__PHP_Incomplete_Class", sizeof("__PHP_Incomplete_Class") - 1)) { ZVAL_FALSE(EX_VAR(opline->result.var)); } else { ZVAL_TRUE(EX_VAR(opline->result.var)); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 454e97f..46da517 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -3820,7 +3820,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_CONST_HANDLER( if (Z_TYPE_P(value) == opline->extended_value) { zend_class_entry *ce = Z_OBJCE_P(value); if (ce->name->len == sizeof("__PHP_Incomplete_Class") - 1 - && !strncmp(ce->name->val, "__PHP_Incomplete_Class", ce->name->len)) { + && !memcmp(ce->name->val, "__PHP_Incomplete_Class", sizeof("__PHP_Incomplete_Class") - 1)) { ZVAL_FALSE(EX_VAR(opline->result.var)); } else { ZVAL_TRUE(EX_VAR(opline->result.var)); @@ -9976,7 +9976,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_TMP_HANDLER(ZE if (Z_TYPE_P(value) == opline->extended_value) { zend_class_entry *ce = Z_OBJCE_P(value); if (ce->name->len == sizeof("__PHP_Incomplete_Class") - 1 - && !strncmp(ce->name->val, "__PHP_Incomplete_Class", ce->name->len)) { + && !memcmp(ce->name->val, "__PHP_Incomplete_Class", sizeof("__PHP_Incomplete_Class") - 1)) { ZVAL_FALSE(EX_VAR(opline->result.var)); } else { ZVAL_TRUE(EX_VAR(opline->result.var)); @@ -13324,7 +13324,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_VAR_HANDLER(ZE if (Z_TYPE_P(value) == opline->extended_value) { zend_class_entry *ce = Z_OBJCE_P(value); if (ce->name->len == sizeof("__PHP_Incomplete_Class") - 1 - && !strncmp(ce->name->val, "__PHP_Incomplete_Class", ce->name->len)) { + && !memcmp(ce->name->val, "__PHP_Incomplete_Class", sizeof("__PHP_Incomplete_Class") - 1)) { ZVAL_FALSE(EX_VAR(opline->result.var)); } else { ZVAL_TRUE(EX_VAR(opline->result.var)); @@ -26165,7 +26165,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_CV_HANDLER(ZEN if (Z_TYPE_P(value) == opline->extended_value) { zend_class_entry *ce = Z_OBJCE_P(value); if (ce->name->len == sizeof("__PHP_Incomplete_Class") - 1 - && !strncmp(ce->name->val, "__PHP_Incomplete_Class", ce->name->len)) { + && !memcmp(ce->name->val, "__PHP_Incomplete_Class", sizeof("__PHP_Incomplete_Class") - 1)) { ZVAL_FALSE(EX_VAR(opline->result.var)); } else { ZVAL_TRUE(EX_VAR(opline->result.var)); diff --git a/ext/standard/type.c b/ext/standard/type.c index d6ea5d5..f884017 100644 --- a/ext/standard/type.c +++ b/ext/standard/type.c @@ -228,7 +228,7 @@ static inline void php_is_type(INTERNAL_FUNCTION_PARAMETERS, int type) if (type == IS_OBJECT) { zend_class_entry *ce = Z_OBJCE_P(arg); if (ce->name->len == sizeof(INCOMPLETE_CLASS) - 1 - && !strncmp(ce->name->val, INCOMPLETE_CLASS, ce->name->len)) { + && !memcmp(ce->name->val, INCOMPLETE_CLASS, sizeof(INCOMPLETE_CLASS) - 1)) { RETURN_FALSE; } } else if (type == IS_RESOURCE) {

« previous php.cvs (#85527) next »