pike.git
/
src
/
docode.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/docode.c:1:
/* || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information.
-
|| $Id: docode.c,v 1.
175
2004
/
10
/
28
20
:
15
:
08
mast
Exp $
+
|| $Id: docode.c,v 1.
176
2006
/
03
/
02
10
:
39
:
47
grubba
Exp $
*/ #include "global.h"
-
RCSID("$Id: docode.c,v 1.
175
2004
/
10
/
28
20
:
15
:
08
mast
Exp $");
+
RCSID("$Id: docode.c,v 1.
176
2006
/
03
/
02
10
:
39
:
47
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:968:
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:2186:
{ 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: { struct compiler_frame *f; int depth=0; for(f=Pike_compiler->compiler_frame; f!=n->u.trampoline.frame;f=f->previous)