Fixed compilator bug that might cause jump depended on unitialized value

This commit is contained in:
Dmitry Stogov 2013-01-09 17:16:47 +04:00
parent c05ee74e7f
commit d4650c5d69
2 changed files with 4 additions and 3 deletions

View File

@ -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);

View File

@ -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); }
;