pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:11386:    f->last_block_level=-1;       f->current_function_number=-2; /* no function */    f->recur_label=-1;    f->is_inline=0;    f->num_args=-1;    f->opt_flags = OPT_SIDE_EFFECT|OPT_EXTERNAL_DEPEND; /* FIXME: Should be 0. */    Pike_compiler->compiler_frame=f;   }    - void low_pop_local_variables(int level) + node *low_pop_local_variables(int level, node *block)   {    struct compilation *c = THIS_COMPILATION;    while(Pike_compiler->compiler_frame->current_number_of_locals > level)    {    int e;    e=--(Pike_compiler->compiler_frame->current_number_of_locals); -  +  if (block) { +  block = mknode(F_COMMA_EXPR, block, +  mknode(F_POP_VALUE, +  mknode(F_ASSIGN, +  mkintnode(0), +  mklocalnode(e, 0)), +  NULL)); +  }    if ((Pike_compiler->compiler_pass == 2) &&    !(Pike_compiler->compiler_frame->variable[e].flags &    LOCAL_VAR_IS_USED)) {    ref_push_string(Pike_compiler->compiler_frame->variable[e].name);    low_yyreport(REPORT_WARNING,    Pike_compiler->compiler_frame->variable[e].file,    Pike_compiler->compiler_frame->variable[e].line,    parser_system_string,    1, "Unused local variable %s.");    }    free_string(Pike_compiler->compiler_frame->variable[e].name);    free_type(Pike_compiler->compiler_frame->variable[e].type);    if(Pike_compiler->compiler_frame->variable[e].def)    free_node(Pike_compiler->compiler_frame->variable[e].def);       free_string(Pike_compiler->compiler_frame->variable[e].file);    } -  +  return block;   }    - void pop_local_variables(int level) + node *pop_local_variables(int level, node *block)   {   #if 1    struct compilation *c = THIS_COMPILATION;    /* We need to save the variables Kuppo (but not their names) */    if(level < Pike_compiler->compiler_frame->min_number_of_locals)    {    /* FIXME: Consider using flags to indicate whether a local variable    * actually is used from a nested scope. */    for(;level<Pike_compiler->compiler_frame->min_number_of_locals;level++)    {
pike.git/src/program.c:11443: Inside #if 1
   Pike_compiler->compiler_frame->variable[level].flags |=    LOCAL_VAR_IS_USED;    }    free_string(Pike_compiler->compiler_frame->variable[level].name);    copy_shared_string(Pike_compiler->compiler_frame->variable[level].name,    empty_pike_string);    /* FIXME: Do we need to keep the filenames? */    }    }   #endif -  low_pop_local_variables(level); +  return low_pop_local_variables(level, block);   }         void pop_compiler_frame(void)   {    struct compiler_frame *f;       f=Pike_compiler->compiler_frame;   #ifdef PIKE_DEBUG    if(!f)    Pike_fatal("Popping out of compiler frames\n");   #endif    -  low_pop_local_variables(0); +  low_pop_local_variables(0, NULL);    if(f->current_type)    free_type(f->current_type);       if(f->current_return_type)    free_type(f->current_return_type);       Pike_compiler->compiler_frame=f->previous;    dmfree((char *)f);   }