pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.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: interpret.c,v 1.111 1998/11/22 11:02:53 hubbe Exp $"); + RCSID("$Id: interpret.c,v 1.112 1999/05/12 05:26:55 hubbe Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"   #include "svalue.h"   #include "array.h"   #include "mapping.h"   #include "error.h"   #include "language.h"   #include "stralloc.h"   #include "constants.h"
pike.git/src/interpret.c:950:    }    break;       CASE(F_LTOSVAL);    lvalue_to_svalue_no_free(sp,sp-2);    sp++;    break;       CASE(F_LTOSVAL2);    sp[0]=sp[-1]; -  lvalue_to_svalue_no_free(sp-1,sp-3); +  sp[-1].type=T_INT; +  sp++; +  lvalue_to_svalue_no_free(sp-2,sp-4);       /* this is so that foo+=bar (and similar things) will be faster, this    * is done by freeing the old reference to foo after it has been pushed    * on the stack. That way foo can have only 1 reference if we are lucky,    * and then the low array/multiset/mapping manipulation routines can be    * destructive if they like    */ -  if( (1 << sp[-1].type) & ( BIT_ARRAY | BIT_MULTISET | BIT_MAPPING | BIT_STRING )) +  if( (1 << sp[-2].type) & ( BIT_ARRAY | BIT_MULTISET | BIT_MAPPING | BIT_STRING ))    {    struct svalue s;    s.type=T_INT;    s.subtype=0;    s.u.integer=0; -  assign_lvalue(sp-3,&s); +  assign_lvalue(sp-4,&s);    } -  sp++; +     break;          CASE(F_ADD_TO_AND_POP);    sp[0]=sp[-1]; -  lvalue_to_svalue_no_free(sp-1,sp-3); +  sp[-1].type=T_INT; +  sp++; +  lvalue_to_svalue_no_free(sp-2,sp-4);       /* this is so that foo+=bar (and similar things) will be faster, this    * is done by freeing the old reference to foo after it has been pushed    * on the stack. That way foo can have only 1 reference if we are lucky,    * and then the low array/multiset/mapping manipulation routines can be    * destructive if they like    */ -  if( (1 << sp[-1].type) & ( BIT_ARRAY | BIT_MULTISET | BIT_MAPPING | BIT_STRING )) +  if( (1 << sp[-2].type) & ( BIT_ARRAY | BIT_MULTISET | BIT_MAPPING | BIT_STRING ))    {    struct svalue s;    s.type=T_INT;    s.subtype=0;    s.u.integer=0; -  assign_lvalue(sp-3,&s); +  assign_lvalue(sp-4,&s);    } -  sp++; +     f_add(2);    assign_lvalue(sp-3,sp-1);    pop_n_elems(3);    break;       CASE(F_GLOBAL_LVALUE);    {    struct identifier *i;    INT32 tmp=GET_ARG() + fp->context.identifier_level;