]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-5.3' into PHP-5.4
authorDmitry Stogov <dmitry@zend.com>
Wed, 9 Jan 2013 13:36:44 +0000 (17:36 +0400)
committerDmitry Stogov <dmitry@zend.com>
Wed, 9 Jan 2013 13:36:44 +0000 (17:36 +0400)
* PHP-5.3:
  Fixed compilator bug that might cause jump depended on unitialized value

1  2 
Zend/zend_compile.c
Zend/zend_language_parser.y

index 9acdc5b35a33804b8678a08dd9c257d87ac1b429,8382b48e4ad30dd54e5d0f5255df2440e86e5f01..8f4f9c47b87b059f8c9871f37f0b96bb88931d25
@@@ -4912,28 -3527,12 +4913,28 @@@ void zend_do_end_class_declaration(cons
                }
        }
  
 -      ce->line_end = zend_get_compiled_lineno(TSRMLS_C);
 +      ce->info.user.line_end = zend_get_compiled_lineno(TSRMLS_C);
 +      
 +      /* Check for traits and proceed like with interfaces.
 +       * The only difference will be a combined handling of them in the end.
 +       * Thus, we need another opcode here. */
 +      if (ce->num_traits > 0) {
 +              zend_op *opline;
 +
 +              ce->traits = NULL;
 +              ce->num_traits = 0;
 +              ce->ce_flags |= ZEND_ACC_IMPLEMENT_TRAITS;
 +
 +              /* opcode generation: */
 +              opline = get_next_op(CG(active_op_array) TSRMLS_CC);
 +              opline->opcode = ZEND_BIND_TRAITS;
 +              SET_NODE(opline->op1, &CG(implementing_class));
 +      }
  
        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) {
 +              if (ce->num_interfaces && !(ce->ce_flags & ZEND_ACC_IMPLEMENT_TRAITS)) {
                        do_verify_abstract_class(TSRMLS_C);
                }
        }
Simple merge