From: Anthony Ferrara <ircmaxell@gmail.com>
Date: Fri, 20 Feb 2015 16:54:33 +0000 (-0500)
Subject: Clean up tri-state logic to use break instead
X-Git-Tag: PRE_PHP7_EREG_MYSQL_REMOVALS~98
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b3be3c5b17e4da1ecfecdb608cce7ceeb176fc43;p=php

Clean up tri-state logic to use break instead
---

diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index c5479af516..dae13483eb 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++;
 			}