pike.git
/
src
/
program.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/program.c:2362:
continue; } if ((ref->id_flags & (ID_INHERITED|ID_USED)) == (ID_INHERITED|ID_USED)) { struct inherit *inh = INHERIT_FROM_PTR(Pike_compiler->new_program, ref); struct reference *sub_ref; /* Find the inherit one level away. */ while (inh->inherit_level > 1) inh--;
+
#if 0
#ifdef PIKE_DEBUG if (!inh->inherit_level) {
-
+
/* FIXME: This is valid for references that are about to be
+
* overridden by the variant dispatcher.
+
*/
Pike_fatal("Inherit without intermediate levels.\n"); } #endif
-
+
#endif
sub_ref = PTR_FROM_INT(inh->prog, cur_id - inh->identifier_level); /* Check if the symbol was used before it was inherited. */ if ((c->lex.pragmas & ID_STRICT_TYPES) && (sub_ref->id_flags & ID_USED)) { struct identifier *sub_id = ID_FROM_PTR(inh->prog, sub_ref); if (IDENTIFIER_IS_FUNCTION(sub_id->identifier_flags)) { if ((Pike_compiler->compiler_pass == 2) && !pike_types_le(ID_FROM_PTR(Pike_compiler->new_program,
pike.git/src/program.c:6030:
i = isidentifier(name); if (Pike_compiler->compiler_pass == 1) { if (flags & ID_VARIANT) { if (i >= 0) { if (!is_variant_dispatcher(prog, i)) { /* This function will be the termination function for * our variant dispatcher. */ struct reference ref = prog->identifier_references[i];
-
if (ref.id_flags & ID_LOCAL) {
-
/*
Mark
it
as a variant. */
-
prog->identifier_references[i].id_flags |= ID_VARIANT;
-
add_variant_dispatcher(name, type, flags);
-
} else {
-
/* Our dispatcher needs
to
occupy
this
ref,
since
-
* it is not local.
-
*
-
* Add our
variant dispatcher
in its place and
-
* copy it as a variant
.
+
/*
Make
sure
to
not
get
complaints
about
multiple
+
*
definitions
when
adding
the
variant dispatcher.
*/
-
+
prog->identifier_references[i].id_flags |= ID_INHERITED;
add_variant_dispatcher(name, type, flags);
-
+
/* Restore the termination function as a variant. */
ref.id_flags |= ID_VARIANT;
-
+
if (is_variant_dispatcher(prog, i)) {
+
/* The termination function got replaced with
+
* the variant dispatcher.
+
*/
add_to_identifier_references(ref);
-
+
} else {
+
/* The termination function is still in the same place. */
+
prog->identifier_references[i].id_flags = ref.id_flags;
} } else if (prog->identifier_references[i].inherit_offset) { /* NB: If we are overriding an inherited dispatcher, there's * no need to go via it, since our new dispatcher can * just continue on with the old ones variant functions. */ add_variant_dispatcher(name, type, flags); } } else { add_variant_dispatcher(name, type, flags);