Skip to content

Commit 625000a

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

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
@@ -4795,6 +4795,7 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name
47954795
/* Prefix class name with name of current namespace */
47964796
znode tmp;
47974797

4798+
tmp.op_type = IS_CONST;
47984799
tmp.u.constant = *CG(current_namespace);
47994800
zval_copy_ctor(&tmp.u.constant);
48004801
zend_do_build_namespace_name(&tmp, &tmp, class_name TSRMLS_CC);
@@ -4931,7 +4932,7 @@ void zend_do_end_class_declaration(const znode *class_token, const znode *parent
49314932
}
49324933

49334934
if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))
4934-
&& ((parent_token->op_type != IS_UNUSED) || (ce->num_interfaces > 0))) {
4935+
&& (parent_token || (ce->num_interfaces > 0))) {
49354936
zend_verify_abstract_class(ce TSRMLS_CC);
49364937
if (ce->num_interfaces && !(ce->ce_flags & ZEND_ACC_IMPLEMENT_TRAITS)) {
49374938
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
@@ -375,13 +375,13 @@ unticked_class_declaration_statement:
375375
implements_list
376376
'{'
377377
class_statement_list
378-
'}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); }
378+
'}' { zend_do_end_class_declaration(&$1, &$3 TSRMLS_CC); }
379379
| interface_entry T_STRING
380380
{ zend_do_begin_class_declaration(&$1, &$2, NULL TSRMLS_CC); }
381381
interface_extends_list
382382
'{'
383383
class_statement_list
384-
'}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); }
384+
'}' { zend_do_end_class_declaration(&$1, NULL TSRMLS_CC); }
385385
;
386386

387387

0 commit comments

Comments
 (0)