| 505 | | dnl mark it as -1 on store, and lookup parent on restore |
| 506 | | IFSTORE(`dst->prototype = (processor->active_class_entry_src && src->prototype) ? (zend_function *) -1 : NULL; DONE(prototype)', ` |
| 507 | | IFRESTORE(`do { |
| 508 | | zend_function *parent; |
| 509 | | if (src->prototype != NULL |
| 510 | | && zend_u_hash_find(&(processor->active_class_entry_dst->parent->function_table), |
| 511 | | UG(unicode) ? IS_UNICODE : IS_STRING, |
| 512 | | src->function_name, xc_zstrlen(UG(unicode), src->function_name) + 1, |
| 513 | | (void **) &parent) == SUCCESS) { |
| 514 | | /* see do_inherit_method_check() */ |
| 515 | | if ((parent->common.fn_flags & ZEND_ACC_ABSTRACT)) { |
| 516 | | dst->prototype = parent; |
| 517 | | } |
| 518 | | else { |
| 519 | | dst->prototype = parent->common.prototype; |
| 520 | | } |
| 521 | | } |
| 522 | | else { |
| 523 | | dst->prototype = NULL; |
| 524 | | } |
| 525 | | DONE(prototype) |
| 526 | | } while (0); |
| 527 | | ', ` |
| 528 | | COPYNULL(prototype) |
| 529 | | ') |
| 530 | | ') |
| | 611 | #ifdef ZEND_ENGINE_2 |
| | 612 | dnl mark it as -1 on store, and lookup parent on restore |
| | 613 | IFSTORE(`dst->prototype = (processor->active_class_entry_src && src->prototype) ? (zend_function *) -1 : NULL; DONE(prototype)', ` |
| | 614 | IFRESTORE(`do { |
| | 615 | zend_function *parent; |
| | 616 | if (src->prototype != NULL |
| | 617 | && zend_u_hash_find(&(processor->active_class_entry_dst->parent->function_table), |
| | 618 | UG(unicode) ? IS_UNICODE : IS_STRING, |
| | 619 | src->function_name, xc_zstrlen(UG(unicode), src->function_name) + 1, |
| | 620 | (void **) &parent) == SUCCESS) { |
| | 621 | /* see do_inherit_method_check() */ |
| | 622 | if ((parent->common.fn_flags & ZEND_ACC_ABSTRACT)) { |
| | 623 | dst->prototype = parent; |
| | 624 | } else if (!(parent->common.fn_flags & ZEND_ACC_CTOR) || (parent->common.prototype && (parent->common.prototype->common.scope->ce_flags & ZEND_ACC_INTERFACE))) { |
| | 625 | /* ctors only have a prototype if it comes from an interface */ |
| | 626 | dst->prototype = parent->common.prototype ? parent->common.prototype : parent; |
| | 627 | } |
| | 628 | else { |
| | 629 | dst->prototype = NULL; |
| | 630 | } |
| | 631 | } |
| | 632 | else { |
| | 633 | dst->prototype = NULL; |
| | 634 | } |
| | 635 | DONE(prototype) |
| | 636 | } while (0); |
| | 637 | ', ` |
| | 638 | COPYNULL(prototype) |
| | 639 | ') |
| | 640 | ') |
| | 641 | #endif |
| | 642 | |