Branch: Tag:

1998-05-25

1998-05-25 10:38:47 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

made it possible to set index in strings

Rev: lib/modules/Yabu.pmod/test.pike:1.3
Rev: src/builtin_functions.c:1.111
Rev: src/docode.c:1.38
Rev: src/docode.h:1.7
Rev: src/interpret.c:1.85
Rev: src/main.c:1.53
Rev: src/module_support.c:1.12
Rev: src/object.c:1.52
Rev: src/operators.c:1.33
Rev: src/operators.h:1.5
Rev: src/stralloc.c:1.36
Rev: src/stralloc.h:1.16
Rev: src/testsuite.in:1.114

4:   ||| See the files COPYING and DISCLAIMER for more information.   \*/   #include "global.h" - RCSID("$Id: interpret.c,v 1.84 1998/05/24 08:44:30 hubbe Exp $"); + RCSID("$Id: interpret.c,v 1.85 1998/05/25 10:38:45 hubbe Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"
1584:       CASE(F_INDEX);    do_index: -  o_index(); +  { +  struct svalue s; +  index_no_free(&s,sp-2,sp-1); +  pop_n_elems(2); +  *sp=s; +  sp++; +  }    print_return_value();    break;   
1600:    }    break;    +  CASE(F_INDIRECT); +  { +  struct svalue s; +  lvalue_to_svalue_no_free(&s,sp-2); +  if(s.type != T_STRING) +  { +  pop_n_elems(2); +  *sp=s; +  sp++; +  }else{ +  struct object *o; +  o=low_clone(string_assignment_program); +  ((struct string_assignment_storage *)o->storage)->lval[0]=sp[-2]; +  ((struct string_assignment_storage *)o->storage)->lval[1]=sp[-1]; +  ((struct string_assignment_storage *)o->storage)->s=s.u.string; +  sp-=2; +  push_object(o); +  } +  } +  print_return_value(); +  break; +  +     CASE(F_SIZEOF);    instr=pike_sizeof(sp-1);    pop_stack();