summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2014-08-25 19:46:21 +0200
committerNikita Popov <nikic@php.net>2014-08-25 19:46:21 +0200
commit7813d85d3d5901b24f77b63538eb6754e161f471 (patch)
tree47e6905136b8b80e08fe9d2830d7638bdb231c01
parent0a230fb4dbb747d7fee209f6c6f50e573c419368 (diff)
downloadphp-git-7813d85d3d5901b24f77b63538eb6754e161f471.tar.gz
Fix for C89
-rw-r--r--Zend/zend_compile.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 8c15a90022..4b292d5bef 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -3642,12 +3642,12 @@ void zend_compile_dim(znode *result, zend_ast *ast, int type TSRMLS_DC) {
}
static zend_bool is_this_fetch(zend_ast *ast) {
- if (ast->kind != ZEND_AST_VAR || ast->child[0]->kind != ZEND_AST_ZVAL) {
- return 0;
+ if (ast->kind == ZEND_AST_VAR && ast->child[0]->kind == ZEND_AST_ZVAL) {
+ zval *name = zend_ast_get_zval(ast->child[0]);
+ return Z_TYPE_P(name) == IS_STRING && zend_str_equals_literal(Z_STR_P(name), "this");
}
- zval *name = zend_ast_get_zval(ast->child[0]);
- return Z_TYPE_P(name) == IS_STRING && zend_str_equals_literal(Z_STR_P(name), "this");
+ return 0;
}
static zend_op *zend_delayed_compile_prop(
@@ -7141,12 +7141,10 @@ void zend_compile_magic_const(znode *result, zend_ast *ast TSRMLS_DC) {
ZEND_ASSERT(ast->attr == T_CLASS_C && ce && ZEND_CE_IS_TRAIT(ce));
{
- zval const_zv;
- ZVAL_STRING(&const_zv, "__CLASS__");
zend_ast *const_ast = zend_ast_create(ZEND_AST_CONST,
- zend_ast_create_zval(&const_zv));
+ zend_ast_create_zval_from_str(STR_INIT("__CLASS__", sizeof("__CLASS__") - 1, 0)));
zend_compile_const(result, const_ast TSRMLS_CC);
- zval_ptr_dtor(&const_zv);
+ zend_ast_destroy(const_ast);
}
}