]> granicus.if.org Git - php/commitdiff
Refix #62358, previous has side-affect
authorXinchen Hui <laruence@php.net>
Thu, 23 Aug 2012 08:06:17 +0000 (16:06 +0800)
committerXinchen Hui <laruence@php.net>
Thu, 23 Aug 2012 08:06:17 +0000 (16:06 +0800)
Zend/zend_compile.c

index 21e5ca2f6be7b8b36b52f623aa634f01f0e4d49b..4ef4b97d6d42bf217d612811e0f6805c385e93e7 100644 (file)
@@ -3786,6 +3786,7 @@ static int zend_traits_merge_functions_to_class(zend_function *fn TSRMLS_DC, int
                }
 
                fn->common.scope = ce;
+               fn->common.prototype = prototype;
 
                if (prototype
                        && (prototype->common.fn_flags & ZEND_ACC_IMPLEMENTED_ABSTRACT
@@ -3803,11 +3804,11 @@ static int zend_traits_merge_functions_to_class(zend_function *fn TSRMLS_DC, int
 
                /* one more thing: make sure we properly implement an abstract method */
                if (existing_fn && existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
+            prototype = fn->common.prototype;
                        do_inheritance_check_on_method(fn, existing_fn TSRMLS_CC);
+            fn->common.prototype = prototype;
                }
 
-               fn->common.prototype = prototype;
-
                /* delete inherited fn if the function to be added is not abstract */
                if (existing_fn
                        && existing_fn->common.scope != ce