Branch: Tag:

2015-03-25

2015-03-25 19:59:05 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Runtime: Fixed over optimization of F_APPEND_MAPPING.

F_APPEND_MAPPING now has the same special cases as F_APPEND_ARRAY.

Fixes obj->map += ([ x:y ]) and obj["map"] += ([ x:y ]) when obj
has lfun::`->=() and/or lfun::`[]=().

1888:    struct mapping *m = val->u.mapping;    if( m->refs == 2 )    { +  if ((TYPEOF(*lval) == T_OBJECT) && +  lval->u.object->prog && +  ((FIND_LFUN(lval->u.object->prog, LFUN_ASSIGN_INDEX) >= 0) || +  (FIND_LFUN(lval->u.object->prog, LFUN_ASSIGN_ARROW) >= 0))) { +  /* There's a function controlling assignments in this object, +  * so we can't alter the mapping in place. +  */ +  } else {    int i;    /* fprintf( stderr, "map_refs==2\n" ); */    for( i=0; i<args; i+=2 )
1896:    return;    }    } +  }       f_aggregate_mapping(args);    f_add(2);