Branch: Tag:

2012-05-08

2012-05-08 22:52:32 by Arne Goedeke <el@laramies.com>

ADT.List: fixed iterators and tail()

4375:    */    PIKEFUN mixed tail()    { -  if (THIS->tail->prev) { -  push_svalue(&THIS->tail->val); +  struct pike_list_node * node = TAIL_SENTINEL(THIS); +  if (THIS->head->next) { +  push_svalue(&node->prev->val);    } else {    Pike_error("Empty list.\n");    }
4482:       loc.o = Pike_fp->current_object;    loc.parent_identifier = Pike_fp->fun; +  if (loc.parent_identifier == FUNCTION_BUILTIN) { +  loc.inherit = loc.o->prog->inherits +  + loc.o->prog->num_inherits - 1; +  } else {    loc.inherit = INHERIT_FROM_INT(loc.o->prog, loc.parent_identifier); -  +  }    find_external_context(&loc, 1);    return (struct List_struct *)(loc.o->storage +    loc.inherit->storage_offset);