diff options
author | Dmitry Stogov <dmitry@zend.com> | 2013-01-09 17:16:47 +0400 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2013-01-09 17:16:47 +0400 |
commit | d4650c5d69ffb49d476a2969c6200879bd424caf (patch) | |
tree | 40edae6f2b1e1de1f4797fbc52fcab57ed4fd4d5 /Zend | |
parent | c05ee74e7ff28b49018bf3e8f452bfd5386d1b68 (diff) | |
download | php-git-d4650c5d69ffb49d476a2969c6200879bd424caf.tar.gz |
Fixed compilator bug that might cause jump depended on unitialized value
Diffstat (limited to 'Zend')
-rw-r--r-- | Zend/zend_compile.c | 3 | ||||
-rw-r--r-- | Zend/zend_language_parser.y | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index e39579594c..8382b48e4a 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3414,6 +3414,7 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name /* Prefix class name with name of current namespace */ znode tmp; + tmp.op_type = IS_CONST; tmp.u.constant = *CG(current_namespace); zval_copy_ctor(&tmp.u.constant); zend_do_build_namespace_name(&tmp, &tmp, class_name TSRMLS_CC); @@ -3529,7 +3530,7 @@ void zend_do_end_class_declaration(const znode *class_token, const znode *parent ce->line_end = zend_get_compiled_lineno(TSRMLS_C); if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) - && ((parent_token->op_type != IS_UNUSED) || (ce->num_interfaces > 0))) { + && (parent_token || (ce->num_interfaces > 0))) { zend_verify_abstract_class(ce TSRMLS_CC); if (ce->num_interfaces) { do_verify_abstract_class(TSRMLS_C); diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y index 2533f605d4..d24fc9cab8 100644 --- a/Zend/zend_language_parser.y +++ b/Zend/zend_language_parser.y @@ -316,13 +316,13 @@ unticked_class_declaration_statement: implements_list '{' class_statement_list - '}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); } + '}' { zend_do_end_class_declaration(&$1, &$3 TSRMLS_CC); } | interface_entry T_STRING { zend_do_begin_class_declaration(&$1, &$2, NULL TSRMLS_CC); } interface_extends_list '{' class_statement_list - '}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); } + '}' { zend_do_end_class_declaration(&$1, NULL TSRMLS_CC); } ; |