Branch: Tag:

2014-12-04

2014-12-04 19:23:58 by Arne Goedeke <el@laramies.com>

propagate CLEAR_ON_EXIT flag in string operations

1778:    if(!r)    {    r=begin_wide_shared_string(size, a->size_shift); -  r->flags |= a->flags & ~15; +  /* we keep both content information and the clear flags */ +  r->flags |= a->flags & (STRING_CONTENT_MASK|STRING_CLEAR_ON_EXIT);    r->min = a->min;    r->max = a->max;    if (a->len <= size) {
1806:    }else{    r=begin_wide_shared_string(size,a->size_shift);    MEMCPY(r->str, a->str, a->len<<a->size_shift); -  r->flags |= a->flags & ~15; +  /* we keep both content information and the clear flags */ +  r->flags |= a->flags & (STRING_CONTENT_MASK|STRING_CLEAR_ON_EXIT);    r->min = a->min;    r->max = a->max;    free_string(a);
1821:       r=begin_wide_shared_string(size,shift);    pike_string_cpy(MKPCHARP_STR(r),a); -  r->flags |= (a->flags & ~15); +  r->flags |= (a->flags & (STRING_CONTENT_MASK|STRING_CLEAR_ON_EXIT));    r->min = a->min;    r->max = a->max;    free_string(a);
1994:    struct pike_string *b)   {    if( !b->len ) { -  ret->flags |= aflags & ~15; +  ret->flags |= aflags & (STRING_CONTENT_MASK|STRING_CLEAR_ON_EXIT);    ret->min = amin;    ret->max = amax;    return;
2010:       ret->flags &= ~(STRING_IS_LOWERCASE | STRING_IS_UPPERCASE);    ret->flags |= (aflags & b->flags & (STRING_IS_LOWERCASE | STRING_IS_UPPERCASE)); +  ret->flags |= (aflags | b->flags) & STRING_CLEAR_ON_EXIT;   }      PMOD_EXPORT void update_flags_for_add( struct pike_string *a, struct pike_string *b)
2027:    }       a->flags &= ~(STRING_IS_LOWERCASE | STRING_IS_UPPERCASE) | b->flags; +  a->flags |= b->flags & STRING_CLEAR_ON_EXIT;   }      /*** Add strings ***/