diff --git a/src/docode.c b/src/docode.c index 52b7c01d08a646f691b8bc60118746672a3399e9..299d171fc856484066c8a33c261a136878811bb5 100644 --- a/src/docode.c +++ b/src/docode.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: docode.c,v 1.69 2000/04/25 09:32:45 hubbe Exp $"); +RCSID("$Id: docode.c,v 1.70 2000/04/30 23:15:16 hubbe Exp $"); #include "las.h" #include "program.h" #include "language.h" @@ -383,6 +383,7 @@ static int do_docode2(node *n,int flags) if(match_types(CAR(n)->type,array_type_string) || match_types(CAR(n)->type,string_type_string) || + match_types(CAR(n)->type,mapping_type_string) || match_types(CAR(n)->type,object_type_string)) { code_expression(CDR(n), 0, "assignment"); diff --git a/src/interpret_functions.h b/src/interpret_functions.h index 87377fe863bcf34a0bd47c07aded58b27b0291ac..c42eb8ada407d0e1ffacb980d375e88a5c04958b 100644 --- a/src/interpret_functions.h +++ b/src/interpret_functions.h @@ -1,5 +1,5 @@ /* - * $Id: interpret_functions.h,v 1.17 2000/04/27 02:12:49 hubbe Exp $ + * $Id: interpret_functions.h,v 1.18 2000/04/30 23:15:16 hubbe Exp $ * * Opcode definitions for the interpreter. */ @@ -1211,7 +1211,7 @@ OPCODE0(F_PUSH_ARRAY, "@") push_array_items(Pike_sp->u.array); BREAK; -OPCODE2(F_LOCAL_LOCAL_INDEX, "local local index") +OPCODE2(F_LOCAL_LOCAL_INDEX, "local[local]") { struct svalue *s=Pike_fp->locals+arg1; if(s->type == PIKE_T_STRING) s->subtype=0; diff --git a/src/mapping.c b/src/mapping.c index c8c64d5859734b6fded5270666b9fab346e4fbef..b75ed0e42bf2db648bacca640035cd1d041a923d 100644 --- a/src/mapping.c +++ b/src/mapping.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: mapping.c,v 1.80 2000/04/27 02:13:28 hubbe Exp $"); +RCSID("$Id: mapping.c,v 1.81 2000/04/30 23:15:16 hubbe Exp $"); #include "main.h" #include "object.h" #include "mapping.h" @@ -1363,8 +1363,15 @@ struct mapping *add_mappings(struct svalue *argp, INT32 args) #endif /* FIXME: need locking! */ - ret=allocate_mapping(MAP_SLOTS(e)); - for(d=0;d<args;d++) + if(argp[0].u.mapping->refs == 1) + { + ret=argp[0].u.mapping; + d=1; + }else{ + ret=allocate_mapping(MAP_SLOTS(e)); + d=0; + } + for(;d<args;d++) MAPPING_LOOP(argp[d].u.mapping) mapping_insert(ret, &k->ind, &k->val); return ret; diff --git a/src/peep.in b/src/peep.in index b1b24efc6eb32d4e4b7d3430fe2c6796b0d36f9a..15652e74a4113aa2e699d30e8b7251585f8d897b 100644 --- a/src/peep.in +++ b/src/peep.in @@ -1,5 +1,5 @@ // -// $Id: peep.in,v 1.33 2000/04/30 16:46:36 nilsson Exp $ +// $Id: peep.in,v 1.34 2000/04/30 23:15:16 hubbe Exp $ // NOP : @@ -265,6 +265,8 @@ SimpleBranch( LOCAL_ARROW($1a, $1b), $2a ) SimpleBranch( LOCAL_ARROW($1a, $1b) ARROW($2a), $3a ) SimpleBranch( LOCAL_ARROW($1a, $1b) ARROW($2a) ARROW($3a), $4a ) SimpleBranch( LOCAL_ARROW($1a, $1b) ARROW($2a) ARROW($3a) ARROW($4a), $5a ) +SimpleBranch( GLOBAL_LOCAL_INDEX($1a, $1b) , $2a ) +SimpleBranch( LOCAL_LOCAL_INDEX($1a, $1b) , $2a ) SimpleBranch( GLOBAL($1a) ARROW ($2a), $3a )