com php-src: Clean up tri-state logic to use break instead: Zend/zend_compile.c
| From: | Xinchen Hui | Date: | Fri, 20 Feb 2015 16:54:33 +0000 |
| Subject: | com php-src: Clean up tri-state logic to use break instead: Zend/zend_compile.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-85033@lists.php.net to get a copy of this message | ||
Commit: b3be3c5b17e4da1ecfecdb608cce7ceeb176fc43
Author: Anthony Ferrara <ircmaxell@gmail.com> Fri, 20 Feb 2015 11:54:33 -0500
Parents: e3b020b945582a45465ae2ae145af9c250be9e54
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b3be3c5b17e4da1ecfecdb608cce7ceeb176fc43
Log:
Clean up tri-state logic to use break instead
Changed paths:
M Zend/zend_compile.c
Diff:
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index c5479af..dae1348 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -3809,17 +3809,18 @@ void zend_compile_declare(zend_ast *ast) /* {{{ */
zend_ast_list *file_ast = zend_ast_get_list(CG(ast));
size_t i = 0;
- signed char valid = 0;
+ zend_bool valid = 0;
/* Check to see if this declare is preceeded only by declare statements */
while (valid == 0 && i < file_ast->children) {
if (file_ast->child[i] == ast) {
valid = 1;
} else if (file_ast->child[i] == NULL) {
- valid = -1;
+ /* Empty statements are not allowed prior to a declare */
+ break;
} else if (file_ast->child[i]->kind != ZEND_AST_DECLARE) {
/* declares can only be preceeded by other declares */
- valid = -1;
+ break;
}
i++;
}