summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r--Zend/zend_compile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index d0bece7228..a91dfeeecf 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -7673,11 +7673,11 @@ void zend_compile_const(znode *result, zend_ast *ast) /* {{{ */
if (zend_string_equals_literal(resolved_name, "__COMPILER_HALT_OFFSET__") || (name_ast->attr != ZEND_NAME_RELATIVE && zend_string_equals_literal(orig_name, "__COMPILER_HALT_OFFSET__"))) {
zend_ast *last = CG(ast);
- while (last->kind == ZEND_AST_STMT_LIST) {
+ while (last && last->kind == ZEND_AST_STMT_LIST) {
zend_ast_list *list = zend_ast_get_list(last);
last = list->child[list->children-1];
}
- if (last->kind == ZEND_AST_HALT_COMPILER) {
+ if (last && last->kind == ZEND_AST_HALT_COMPILER) {
result->op_type = IS_CONST;
ZVAL_LONG(&result->u.constant, Z_LVAL_P(zend_ast_get_zval(last->child[0])));
zend_string_release(resolved_name);