Skip to content

Commit c3ebd63

Browse files
committed
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4: Fixed compilator bug that might cause jump depended on unitialized value
2 parents 326f896 + 625000a commit c3ebd63

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Zend/zend_compile.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4933,6 +4933,7 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name
49334933
/* Prefix class name with name of current namespace */
49344934
znode tmp;
49354935

4936+
tmp.op_type = IS_CONST;
49364937
tmp.u.constant = *CG(current_namespace);
49374938
zval_copy_ctor(&tmp.u.constant);
49384939
zend_do_build_namespace_name(&tmp, &tmp, class_name TSRMLS_CC);
@@ -5069,7 +5070,7 @@ void zend_do_end_class_declaration(const znode *class_token, const znode *parent
50695070
}
50705071

50715072
if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))
5072-
&& ((parent_token->op_type != IS_UNUSED) || (ce->num_interfaces > 0))) {
5073+
&& (parent_token || (ce->num_interfaces > 0))) {
50735074
zend_verify_abstract_class(ce TSRMLS_CC);
50745075
if (ce->num_interfaces && !(ce->ce_flags & ZEND_ACC_IMPLEMENT_TRAITS)) {
50755076
do_verify_abstract_class(TSRMLS_C);

Zend/zend_language_parser.y

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,13 +386,13 @@ unticked_class_declaration_statement:
386386
implements_list
387387
'{'
388388
class_statement_list
389-
'}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); }
389+
'}' { zend_do_end_class_declaration(&$1, &$3 TSRMLS_CC); }
390390
| interface_entry T_STRING
391391
{ zend_do_begin_class_declaration(&$1, &$2, NULL TSRMLS_CC); }
392392
interface_extends_list
393393
'{'
394394
class_statement_list
395-
'}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); }
395+
'}' { zend_do_end_class_declaration(&$1, NULL TSRMLS_CC); }
396396
;
397397

398398

0 commit comments

Comments
 (0)