pike.git / src / encode.c

version» Context lines:

pike.git/src/encode.c:1056:    if(TYPEOF(Pike_sp[-1]) == TYPEOF(*val))    Pike_error("Error in master()->nameof(), same type returned.\n");    if(TYPEOF(Pike_sp[-1]) == T_INT &&    SUBTYPEOF(Pike_sp[-1]) == NUMBER_UNDEFINED)    {    struct program *p=val->u.program;    debug_malloc_touch(p);    pop_stack();    if( (p->flags & PROGRAM_HAS_C_METHODS) || p->event_handler )    { +  int has_local_c_methods = 0; +  for (d = 0; d < p->num_identifiers; d++) { +  if (IDENTIFIER_IS_C_FUNCTION(p->identifiers[d].identifier_flags)) { +  has_local_c_methods = 1; +  break; +  } +  } +  if (has_local_c_methods) {    if(p->parent)    {    /* We have to remove ourselves from the cache for now */    struct svalue tmp = entry_id; -  +  EDB(1, fprintf(stderr, +  "%*sencode: encoding C program via parent.\n", +  data->depth, ""));    map_delete(data->encoded, val);       code_entry(TAG_PROGRAM, 2, data);    ref_push_program(p->parent);    encode_value2(Pike_sp-1, data, 0);       ref_push_program(p);    f_function_name(1);   #if 0    if(TYPEOF(Pike_sp[-1]) == PIKE_T_INT)
pike.git/src/encode.c:1085:       /* Put value back in cache */    mapping_insert(data->encoded, val, &tmp);    goto encode_done;    }    if( p->event_handler )    Pike_error("Cannot encode programs with event handlers.\n");   #if 0    Pike_error("Cannot encode C programs.\n");   #endif +  } else { +  EDB(1, fprintf(stderr, +  "%*sencode: encoding program overloading a C program.\n", +  data->depth, ""));    } -  +  }      #ifdef OLD_PIKE_ENCODE_PROGRAM       EDB(1,    fprintf(stderr, "%*sencode: encoding program in old style\n",    data->depth, ""));       /* Type 1 -- Old-style encoding. */       code_entry(TAG_PROGRAM, 1, data);
pike.git/src/encode.c:1881: Inside #if defined(ENCODE_DEBUG)
  #ifdef ENCODE_DEBUG    data->depth -= 2;   #endif    }       /* Encode the constant values table. */    {    struct svalue str_sval;    SET_SVAL(str_sval, T_STRING, 0, string, NULL);    +  EDB(2, +  fprintf(stderr, "%*sencode: encoding constants\n", +  data->depth, "")); +     /* constants */    for(d=0;d<p->num_constants;d++)    { -  +  EDB(5, +  fprintf(stderr, "%*sencode: encoding constant #%d\n", +  data->depth, "", d)); +    #ifdef PIKE_PORTABLE_BYTECODE    if (((TYPEOF(p->constants[d].sval) == T_FUNCTION) &&    (SUBTYPEOF(p->constants[d].sval) == FUNCTION_BUILTIN)) ||    (TYPEOF(p->constants[d].sval) == T_TYPE)) {    /* Already encoded above. */    continue;    }   #endif /* PIKE_PORTABLE_BYTECODE */    /* value */    encode_value2(&p->constants[d].sval, data, 0);