pike.git / src / encode.c

version» Context lines:

pike.git/src/encode.c:1378:    */    if ((i < 0) || !is_variant_dispatcher(p, i)) {    Pike_error("Failed to find dispatcher for inherited "    "variant function: %S\n", id->name);    }    if (PTR_FROM_INT(p, i)->inherit_offset) {    Pike_error("Dispatcher for variant function %S "    "is inherited.\n", id->name);    }    gs_flags = ref->id_flags & PTR_FROM_INT(p, i)->id_flags; -  if (id_dumped[PTR_FROM_INT(p, i)->identifier_offset] || -  (i < d)) { +  if (id_dumped[PTR_FROM_INT(p, i)->identifier_offset]) {    /* Either already dumped, or the dispatcher is in    * front of us, which indicates that we are overloading    * an inherited function with a variant.    */    gs_flags |= ID_VARIANT;    } else {    /* First variant. */    id_dumped[PTR_FROM_INT(p, i)->identifier_offset] = 1;    }    }
pike.git/src/encode.c:1528:    code_number(id->opt_flags, data);    break;       case IDENTIFIER_C_FUNCTION:    if (is_variant_dispatcher(p, d)) {    /* This is handled by end_first_pass() et all. */    /* NB: This can be reached even though id_dumped    * for it gets set by the variant functions,    * if it is overriding an old definition.    * -  * We thus need to make sure id_dumped stays cleared. +  * Note that this means that even the first local +  * function must have the variant modifier (since +  * otherwise it would have overridden the old def +  * and not the dispatcher). This is handled +  * automatically by the use of id_dumped for the +  * dispatcher as marker for whether the first +  * variant has been added or not.    */ -  id_dumped[ref->identifier_offset] = 0; +     continue;    }    /* Not supported. */    Pike_error("Cannot encode functions implemented in C "    "(identifier=\"%S\").\n",    id->name);    break;       case IDENTIFIER_VARIABLE:    if (d < d_min) {