pike.git / src / docode.c

version» Context lines:

pike.git/src/docode.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: docode.c,v 1.107 2003/09/19 14:00:23 grubba Exp $"); + RCSID("$Id: docode.c,v 1.108 2006/03/02 10:38:51 grubba Exp $");   #include "las.h"   #include "program.h"   #include "pike_types.h"   #include "stralloc.h"   #include "interpret.h"   #include "constants.h"   #include "array.h"   #include "pike_macros.h"   #include "pike_error.h"   #include "pike_memory.h"
pike.git/src/docode.c:728:    default:    switch(CDR(n)->token)    {    case F_LOCAL:    if(CDR(n)->u.integer.a >=    find_local_frame(CDR(n)->u.integer.b)->max_number_of_locals)    yyerror("Illegal to use local variable here.");       if(CDR(n)->u.integer.b) goto normal_assign;    +  if (CDR(n)->node_info & OPT_ASSIGNMENT) { +  /* Initialize. */ +  emit0(F_CONST0); +  emit1(F_ASSIGN_LOCAL_AND_POP, CDR(n)->u.integer.a); +  }    code_expression(CAR(n), 0, "RHS");    emit1(flags & DO_POP ? F_ASSIGN_LOCAL_AND_POP:F_ASSIGN_LOCAL,    CDR(n)->u.integer.a );    break;       /* FIXME: Make special case for F_EXTERNAL */    case F_IDENTIFIER:    if(!IDENTIFIER_IS_VARIABLE( ID_FROM_INT(Pike_compiler->new_program, CDR(n)->u.id.number)->identifier_flags))    {    yyerror("Cannot assign functions or constants.\n");
pike.git/src/docode.c:1661:    {    emit2(F_LEXICAL_LOCAL_LVALUE,n->u.id.number,n->u.integer.b);    return 2;    }else{    emit2(F_LEXICAL_LOCAL,n->u.id.number,n->u.integer.b);    return 1;    }    }else{    if(flags & WANT_LVALUE)    { +  if (n->node_info & OPT_ASSIGNMENT) { +  /* Initialize the variable. */ +  emit0(F_CONST0); +  emit1(F_ASSIGN_LOCAL_AND_POP, n->u.integer.a); +  }    emit1(F_LOCAL_LVALUE,n->u.id.number);    return 2;    }else{ -  emit1(F_LOCAL,n->u.id.number); +  if (n->node_info & OPT_ASSIGNMENT) { +  /* Initialize the variable. */ +  emit0(F_CONST0); +  emit1(F_ASSIGN_LOCAL, n->u.integer.a); +  } else { +  emit1(F_LOCAL, n->u.integer.a); +  }    return 1;    }    }       case F_TRAMPOLINE:    emit1(F_TRAMPOLINE,n->u.id.number);    return 1;       case F_IDENTIFIER:    if(IDENTIFIER_IS_FUNCTION(ID_FROM_INT(Pike_compiler->new_program, n->u.id.number)->identifier_flags))