~ubuntu-branches/ubuntu/lucid/php5/lucid

« back to all changes in this revision

Viewing changes to Zend/zend_compile.c

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-03-16 09:09:50 UTC
  • mfrom: (1.1.18 upstream) (0.3.10 sid)
  • Revision ID: james.westby@ubuntu.com-20100316090950-e36m0pzranoixifd
Tags: 5.3.2-1ubuntu1
* Merge from debian unstable: 
  - debian/control:
    * Dropped firebird2.1-dev, libc-client-dev, libmcrypt-dev as it is in universe.
    * Dropped libmysqlclient15-dev, build against mysql 5.1.
    * Dropped libcurl-dev not in the archive.
    * Suggest php5-suhosin rather than recommends.
    * Dropped php5-imap, php5-interbase, php5-mcrypt since we have versions already in
      universe.
    * Dropped libonig-dev and libqgdbm since its in universe. (will be re-added in lucid+1)
    * Dropped locales-all.
  - modulelist: Drop imap, interbase, and mcrypt.
  - debian/rules:
    * Dropped building of mcrypt, imap, and interbase.
    * Install apport hook for php5.
  - Dropped debian/patches/libedit_is_editline.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
   +----------------------------------------------------------------------+
3
3
   | Zend Engine                                                          |
4
4
   +----------------------------------------------------------------------+
5
 
   | Copyright (c) 1998-2009 Zend Technologies Ltd. (http://www.zend.com) |
 
5
   | Copyright (c) 1998-2010 Zend Technologies Ltd. (http://www.zend.com) |
6
6
   +----------------------------------------------------------------------+
7
7
   | This source file is subject to version 2.00 of the Zend license,     |
8
8
   | that is bundled with this package in the file LICENSE, and is        | 
17
17
   +----------------------------------------------------------------------+
18
18
*/
19
19
 
20
 
/* $Id: zend_compile.c 289432 2009-10-09 17:23:01Z pajoye $ */
 
20
/* $Id: zend_compile.c 293155 2010-01-05 20:46:53Z sebastian $ */
21
21
 
22
22
#include <zend_language_parser.h>
23
23
#include "zend.h"
161
161
        CG(encoding_detector) = NULL;
162
162
        CG(encoding_converter) = NULL;
163
163
        CG(encoding_oddlen) = NULL;
 
164
        CG(encoding_declared) = 0;
164
165
#endif /* ZEND_MULTIBYTE */
165
166
}
166
167
/* }}} */
2875
2876
        zval **old_constant;
2876
2877
 
2877
2878
        if (zend_hash_quick_find(child_constants_table, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void**)&old_constant) == SUCCESS) {
2878
 
          if (*old_constant != *parent_constant) {
2879
 
                        zend_error(E_COMPILE_ERROR, "Cannot inherit previously-inherited constant %s from interface %s", hash_key->arKey, iface->name);
 
2879
                if (*old_constant != *parent_constant) {
 
2880
                        zend_error(E_COMPILE_ERROR, "Cannot inherit previously-inherited or override constant %s from interface %s", hash_key->arKey, iface->name);
2880
2881
                }
2881
2882
                return 0;
2882
2883
        }
2884
2885
}
2885
2886
/* }}} */
2886
2887
 
 
2888
static int do_interface_constant_check(zval **val TSRMLS_DC, int num_args, va_list args, const zend_hash_key *key) /* {{{ */
 
2889
{
 
2890
        zend_class_entry **iface = va_arg(args, zend_class_entry**);
 
2891
 
 
2892
        do_inherit_constant_check(&(*iface)->constants_table, (const zval **) val, key, *iface);
 
2893
 
 
2894
        return ZEND_HASH_APPLY_KEEP;
 
2895
}
 
2896
/* }}} */
 
2897
 
2887
2898
ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC) /* {{{ */
2888
2899
{
2889
2900
        zend_uint i, ignore = 0;
2902
2913
                        }
2903
2914
                }
2904
2915
        }
2905
 
        if (!ignore) {
 
2916
        if (ignore) {
 
2917
                /* Check for attempt to redeclare interface constants */
 
2918
                zend_hash_apply_with_arguments(&ce->constants_table TSRMLS_CC, (apply_func_args_t) do_interface_constant_check, 1, &iface);
 
2919
        } else {
2906
2920
                if (ce->num_interfaces >= current_iface_num) {
2907
2921
                        if (ce->type == ZEND_INTERNAL_CLASS) {
2908
2922
                                ce->interfaces = (zend_class_entry **) realloc(ce->interfaces, sizeof(zend_class_entry *) * (++current_iface_num));
3658
3672
                zend_error(E_COMPILE_ERROR, "Cannot redefine class constant %s::%s", CG(active_class_entry)->name, var_name->u.constant.value.str.val);
3659
3673
        }
3660
3674
        FREE_PNODE(var_name);
 
3675
        
 
3676
        if (CG(doc_comment)) {
 
3677
                efree(CG(doc_comment));
 
3678
                CG(doc_comment) = NULL;
 
3679
                CG(doc_comment_len) = 0;
 
3680
        }
3661
3681
}
3662
3682
/* }}} */
3663
3683
 
4644
4664
                                --num;
4645
4665
                        }
4646
4666
 
4647
 
                        if (num > 0 || CG(encoding_declared)) {
 
4667
                        if (num > 0) {
4648
4668
                                zend_error(E_COMPILE_ERROR, "Encoding declaration pragma must be the very first statement in the script");
4649
4669
                        }
4650
4670
                }