Changeset 11802 in webkit for trunk/JavaScriptCore/kjs


Ignore:
Timestamp:
Dec 29, 2005, 3:16:11 AM (19 years ago)
Author:
ggaren
Message:

Reviewed by mjs.

This patch does four things:
(1) Standardizes all our linked list nodes to use "next" as their next
pointers.
(2) Creates the ListRefPtr<T> class, a subclass of RefPtr<T> specialized
to iteratively deref "next" pointers.
(3) Standardizes our linked list nodes to use ListRefPtr<T> and
implement the releaseNext() function used by ~ListRefPtr<T>().
(4) Adds to RefPtr<T> the release() method used by releaseNext().

  • Modified existing mozilla test to ensure it would make deployment builds crash as well.
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • kjs/nodes.cpp: (ElementNode::evaluate): (PropertyListNode::evaluate): (ArgumentListNode::evaluateList): (StatListNode::StatListNode): (StatListNode::execute): (StatListNode::processVarDecls): (VarDeclListNode::evaluate): (VarDeclListNode::processVarDecls): (VarStatementNode::execute): (VarStatementNode::processVarDecls): (BlockNode::BlockNode): (CaseClauseNode::evalStatements): (CaseClauseNode::processVarDecls): (ClauseListNode::processVarDecls): (CaseBlockNode::CaseBlockNode): (CaseBlockNode::evalBlock): (SourceElementsNode::SourceElementsNode): (SourceElementsNode::execute): (SourceElementsNode::processFuncDecl): (SourceElementsNode::processVarDecls):
  • kjs/nodes.h: (KJS::ElementNode::ElementNode): (KJS::ElementNode::releaseNext): (KJS::ArrayNode::ArrayNode): (KJS::PropertyListNode::PropertyListNode): (KJS::PropertyListNode::releaseNext): (KJS::ObjectLiteralNode::ObjectLiteralNode): (KJS::ArgumentListNode::ArgumentListNode): (KJS::ArgumentListNode::releaseNext): (KJS::ArgumentsNode::ArgumentsNode): (KJS::StatListNode::releaseNext): (KJS::VarDeclListNode::VarDeclListNode): (KJS::VarDeclListNode::releaseNext): (KJS::VarStatementNode::VarStatementNode): (KJS::ForNode::ForNode): (KJS::CaseClauseNode::CaseClauseNode): (KJS::ClauseListNode::ClauseListNode): (KJS::ClauseListNode::getClause): (KJS::ClauseListNode::getNext): (KJS::ClauseListNode::releaseNext): (KJS::ParameterNode::ParameterNode): (KJS::ParameterNode::releaseNext): (KJS::SourceElementsNode::releaseNext):
  • kjs/nodes2string.cpp: (ElementNode::streamTo): (PropertyListNode::streamTo): (ArgumentListNode::streamTo): (StatListNode::streamTo): (VarDeclListNode::streamTo): (VarStatementNode::streamTo): (CaseClauseNode::streamTo): (ClauseListNode::streamTo): (CaseBlockNode::streamTo): (SourceElementsNode::streamTo):
  • kxmlcore/ListRefPtr.h: Added. (KXMLCore::ListRefPtr::ListRefPtr): (KXMLCore::ListRefPtr::~ListRefPtr): (KXMLCore::ListRefPtr::operator=):
  • kxmlcore/RefPtr.h: (KXMLCore::RefPtr::release):
Location:
trunk/JavaScriptCore/kjs
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/nodes.cpp

    r11566 r11802  
    310310  JSObject *array = exec->lexicalInterpreter()->builtinArray()->construct(exec, List::empty());
    311311  int length = 0;
    312   for (ElementNode *n = this; n; n = n->list.get()) {
     312  for (ElementNode *n = this; n; n = n->next.get()) {
    313313    JSValue *val = n->node->evaluate(exec);
    314314    KJS_CHECKEXCEPTIONVALUE
     
    361361  JSObject *obj = exec->lexicalInterpreter()->builtinObject()->construct(exec, List::empty());
    362362 
    363   for (PropertyListNode *p = this; p; p = p->list.get()) {
     363  for (PropertyListNode *p = this; p; p = p->next.get()) {
    364364    JSValue *n = p->node->name->evaluate(exec);
    365365    KJS_CHECKEXCEPTIONVALUE
     
    450450  List l;
    451451
    452   for (ArgumentListNode *n = this; n; n = n->list.get()) {
     452  for (ArgumentListNode *n = this; n; n = n->next.get()) {
    453453    JSValue *v = n->expr->evaluate(exec);
    454454    KJS_CHECKEXCEPTIONLIST
     
    14161416
    14171417StatListNode::StatListNode(StatementNode *s)
    1418   : statement(s), list(this)
     1418  : statement(s), next(this)
    14191419{
    14201420  setLoc(s->firstLine(), s->lastLine(), s->sourceId());
     
    14221422 
    14231423StatListNode::StatListNode(StatListNode *l, StatementNode *s)
    1424   : statement(s), list(l->list)
    1425 {
    1426   l->list = this;
     1424  : statement(s), next(l->next)
     1425{
     1426  l->next = this;
    14271427  setLoc(l->firstLine(), s->lastLine(), l->sourceId());
    14281428}
     
    14381438  JSValue *v = c.value();
    14391439 
    1440   for (StatListNode *n = list.get(); n; n = n->list.get()) {
     1440  for (StatListNode *n = next.get(); n; n = n->next.get()) {
    14411441    Completion c2 = n->statement->execute(exec);
    14421442    KJS_ABORTPOINT
     
    14541454void StatListNode::processVarDecls(ExecState *exec)
    14551455{
    1456   for (StatListNode *n = this; n; n = n->list.get())
     1456  for (StatListNode *n = this; n; n = n->next.get())
    14571457    n->statement->processVarDecls(exec);
    14581458}
     
    15271527JSValue *VarDeclListNode::evaluate(ExecState *exec)
    15281528{
    1529   for (VarDeclListNode *n = this; n; n = n->list.get()) {
     1529  for (VarDeclListNode *n = this; n; n = n->next.get()) {
    15301530    n->var->evaluate(exec);
    15311531    KJS_CHECKEXCEPTIONVALUE
     
    15361536void VarDeclListNode::processVarDecls(ExecState *exec)
    15371537{
    1538   for (VarDeclListNode *n = this; n; n = n->list.get())
     1538  for (VarDeclListNode *n = this; n; n = n->next.get())
    15391539    n->var->processVarDecls(exec);
    15401540}
     
    15471547  KJS_BREAKPOINT;
    15481548
    1549   (void) list->evaluate(exec);
     1549  (void) next->evaluate(exec);
    15501550  KJS_CHECKEXCEPTION
    15511551
     
    15551555void VarStatementNode::processVarDecls(ExecState *exec)
    15561556{
    1557   list->processVarDecls(exec);
     1557  next->processVarDecls(exec);
    15581558}
    15591559
     
    15631563{
    15641564  if (s) {
    1565     source = s->elements;
    1566     s->elements = 0;
     1565    source = s->next;
     1566    s->next = 0;
    15671567    setLoc(s->firstLine(), s->lastLine(), s->sourceId());
    15681568  } else {
     
    19851985Completion CaseClauseNode::evalStatements(ExecState *exec)
    19861986{
    1987   if (list)
    1988     return list->execute(exec);
     1987  if (next)
     1988    return next->execute(exec);
    19891989  else
    19901990    return Completion(Normal, jsUndefined());
     
    19931993void CaseClauseNode::processVarDecls(ExecState *exec)
    19941994{
    1995   if (list)
    1996     list->processVarDecls(exec);
     1995  if (next)
     1996    next->processVarDecls(exec);
    19971997}
    19981998
     
    20092009void ClauseListNode::processVarDecls(ExecState *exec)
    20102010{
    2011   for (ClauseListNode *n = this; n; n = n->nx.get())
    2012     if (n->cl)
    2013       n->cl->processVarDecls(exec);
     2011  for (ClauseListNode *n = this; n; n = n->next.get())
     2012    if (n->clause)
     2013      n->clause->processVarDecls(exec);
    20142014}
    20152015
     
    20202020{
    20212021  if (l1) {
    2022     list1 = l1->nx;
    2023     l1->nx = 0;
     2022    list1 = l1->next;
     2023    l1->next = 0;
    20242024  } else {
    20252025    list1 = 0;
     
    20292029
    20302030  if (l2) {
    2031     list2 = l2->nx;
    2032     l2->nx = 0;
     2031    list2 = l2->next;
     2032    l2->next = 0;
    20332033  } else {
    20342034    list2 = 0;
     
    20532053
    20542054    while (a) {
    2055       clause = a->clause();
    2056       a = a->next();
     2055      clause = a->getClause();
     2056      a = a->getNext();
    20572057      v = clause->evaluate(exec);
    20582058      KJS_CHECKEXCEPTION
     
    20622062          return res;
    20632063        while (a) {
    2064           res = a->clause()->evalStatements(exec);
     2064          res = a->getClause()->evalStatements(exec);
    20652065          if (res.complType() != Normal)
    20662066            return res;
    2067           a = a->next();
     2067          a = a->getNext();
    20682068        }
    20692069        break;
     
    20722072
    20732073  while (b) {
    2074     clause = b->clause();
    2075     b = b->next();
     2074    clause = b->getClause();
     2075    b = b->getNext();
    20762076    v = clause->evaluate(exec);
    20772077    KJS_CHECKEXCEPTION
     
    20932093 step18:
    20942094  while (b) {
    2095     clause = b->clause();
     2095    clause = b->getClause();
    20962096    res = clause->evalStatements(exec);
    20972097    if (res.complType() != Normal)
    20982098      return res;
    2099     b = b->next();
     2099    b = b->getNext();
    21002100  }
    21012101
     
    23062306// ------------------------------ SourceElementsNode ---------------------------
    23072307
     2308int SourceElementsNode::count = 0;
     2309
    23082310SourceElementsNode::SourceElementsNode(StatementNode *s1)
    2309   : element(s1), elements(this)
     2311  : node(s1), next(this)
    23102312{
    23112313  setLoc(s1->firstLine(), s1->lastLine(), s1->sourceId());
    23122314}
    2313  
     2315
    23142316SourceElementsNode::SourceElementsNode(SourceElementsNode *s1, StatementNode *s2)
    2315   : element(s2), elements(s1->elements)
    2316 {
    2317   s1->elements = this;
     2317  : node(s2), next(s1->next)
     2318{
     2319  s1->next = this;
    23182320  setLoc(s1->firstLine(), s2->lastLine(), s1->sourceId());
    23192321}
     
    23242326  KJS_CHECKEXCEPTION
    23252327
    2326   Completion c1 = element->execute(exec);
     2328  Completion c1 = node->execute(exec);
    23272329  KJS_CHECKEXCEPTION;
    23282330  if (c1.complType() != Normal)
    23292331    return c1;
    23302332 
    2331   for (SourceElementsNode *n = elements.get(); n; n = n->elements.get()) {
    2332     Completion c2 = n->element->execute(exec);
     2333  for (SourceElementsNode *n = next.get(); n; n = n->next.get()) {
     2334    Completion c2 = n->node->execute(exec);
    23332335    if (c2.complType() != Normal)
    23342336      return c2;
     
    23452347void SourceElementsNode::processFuncDecl(ExecState *exec)
    23462348{
    2347   for (SourceElementsNode *n = this; n; n = n->elements.get())
    2348     n->element->processFuncDecl(exec);
     2349  for (SourceElementsNode *n = this; n; n = n->next.get())
     2350    n->node->processFuncDecl(exec);
    23492351}
    23502352
    23512353void SourceElementsNode::processVarDecls(ExecState *exec)
    23522354{
    2353   for (SourceElementsNode *n = this; n; n = n->elements.get())
    2354     n->element->processVarDecls(exec);
     2355  for (SourceElementsNode *n = this; n; n = n->next.get())
     2356    n->node->processVarDecls(exec);
    23552357}
    23562358
  • trunk/JavaScriptCore/kjs/nodes.h

    r11566 r11802  
    2727
    2828#include <kxmlcore/RefPtr.h>
     29#include <kxmlcore/ListRefPtr.h>
    2930
    3031#include "internal.h"
     
    220221  public:
    221222    // list pointer is tail of a circular list, cracked in the ArrayNode ctor
    222     ElementNode(int e, Node *n) : list(this), elision(e), node(n) { }
     223    ElementNode(int e, Node *n) : next(this), elision(e), node(n) { }
    223224    ElementNode(ElementNode *l, int e, Node *n)
    224       : list(l->list), elision(e), node(n) { l->list = this; }
    225     JSValue *evaluate(ExecState *exec);
    226     virtual void streamTo(SourceStream &s) const;
     225      : next(l->next), elision(e), node(n) { l->next = this; }
     226    JSValue *evaluate(ExecState *exec);
     227    virtual void streamTo(SourceStream &s) const;
     228    PassRefPtr<ElementNode> releaseNext() { return next.release(); }
    227229  private:
    228230    friend class ArrayNode;
    229     RefPtr<ElementNode> list;
     231    ListRefPtr<ElementNode> next;
    230232    int elision;
    231233    RefPtr<Node> node;
     
    236238    ArrayNode(int e) : element(0), elision(e), opt(true) { }
    237239    ArrayNode(ElementNode *ele)
    238       : element(ele->list), elision(0), opt(false) { ele->list = 0; }
     240      : element(ele->next), elision(0), opt(false) { ele->next = 0; }
    239241    ArrayNode(int eli, ElementNode *ele)
    240       : element(ele->list), elision(eli), opt(true) { ele->list = 0; }
     242      : element(ele->next), elision(eli), opt(true) { ele->next = 0; }
    241243    JSValue *evaluate(ExecState *exec);
    242244    virtual void streamTo(SourceStream &s) const;
     
    276278    // list pointer is tail of a circular list, cracked in the ObjectLiteralNode ctor
    277279    PropertyListNode(PropertyNode *n)
    278 
    279       : node(n), list(this) { }
     280      : node(n), next(this) { }
    280281    PropertyListNode(PropertyNode *n, PropertyListNode *l)
    281       : node(n), list(l->list) { l->list = this; }
    282     JSValue *evaluate(ExecState *exec);
    283     virtual void streamTo(SourceStream &s) const;
     282      : node(n), next(l->next) { l->next = this; }
     283    JSValue *evaluate(ExecState *exec);
     284    virtual void streamTo(SourceStream &s) const;
     285    PassRefPtr<PropertyListNode> releaseNext() { return next.release(); }
    284286  private:
    285287    friend class ObjectLiteralNode;
    286288    RefPtr<PropertyNode> node;
    287     RefPtr<PropertyListNode> list;
     289    ListRefPtr<PropertyListNode> next;
    288290  };
    289291
     
    291293  public:
    292294    ObjectLiteralNode() : list(0) { }
    293     ObjectLiteralNode(PropertyListNode *l) : list(l->list) { l->list = 0; }
     295    ObjectLiteralNode(PropertyListNode *l) : list(l->next) { l->next = 0; }
    294296    JSValue *evaluate(ExecState *exec);
    295297    virtual void streamTo(SourceStream &s) const;
     
    333335  public:
    334336    // list pointer is tail of a circular list, cracked in the ArgumentsNode ctor
    335     ArgumentListNode(Node *e) : list(this), expr(e) { }
     337    ArgumentListNode(Node *e) : next(this), expr(e) { }
    336338    ArgumentListNode(ArgumentListNode *l, Node *e)
    337       : list(l->list), expr(e) { l->list = this; }
     339      : next(l->next), expr(e) { l->next = this; }
    338340    JSValue *evaluate(ExecState *exec);
    339341    List evaluateList(ExecState *exec);
    340342    virtual void streamTo(SourceStream &s) const;
     343    PassRefPtr<ArgumentListNode> releaseNext() { return next.release(); }
    341344  private:
    342345    friend class ArgumentsNode;
    343     RefPtr<ArgumentListNode> list;
     346    ListRefPtr<ArgumentListNode> next;
    344347    RefPtr<Node> expr;
    345348  };
     
    349352    ArgumentsNode() : list(0) { }
    350353    ArgumentsNode(ArgumentListNode *l)
    351       : list(l->list) { l->list = 0; }
     354      : list(l->next) { l->next = 0; }
    352355    JSValue *evaluate(ExecState *exec);
    353356    List evaluateList(ExecState *exec);
     
    743746    virtual void processVarDecls(ExecState *exec);
    744747    virtual void streamTo(SourceStream &s) const;
     748    PassRefPtr<StatListNode> releaseNext() { return next.release(); }
    745749  private:
    746750    friend class CaseClauseNode;
    747751    RefPtr<StatementNode> statement;
    748     RefPtr<StatListNode> list;
     752    ListRefPtr<StatListNode> next;
    749753  };
    750754
     
    774778  public:
    775779    // list pointer is tail of a circular list, cracked in the ForNode/VarStatementNode ctor
    776     VarDeclListNode(VarDeclNode *v) : list(this), var(v) {}
     780    VarDeclListNode(VarDeclNode *v) : next(this), var(v) {}
    777781    VarDeclListNode(VarDeclListNode *l, VarDeclNode *v)
    778       : list(l->list), var(v) { l->list = this; }
    779     JSValue *evaluate(ExecState *exec);
    780     virtual void processVarDecls(ExecState *exec);
    781     virtual void streamTo(SourceStream &s) const;
     782      : next(l->next), var(v) { l->next = this; }
     783    JSValue *evaluate(ExecState *exec);
     784    virtual void processVarDecls(ExecState *exec);
     785    virtual void streamTo(SourceStream &s) const;
     786    PassRefPtr<VarDeclListNode> releaseNext() { return next.release(); }
    782787  private:
    783788    friend class ForNode;
    784789    friend class VarStatementNode;
    785     RefPtr<VarDeclListNode> list;
     790    ListRefPtr<VarDeclListNode> next;
    786791    RefPtr<VarDeclNode> var;
    787792  };
     
    789794  class VarStatementNode : public StatementNode {
    790795  public:
    791     VarStatementNode(VarDeclListNode *l) : list(l->list) { l->list = 0; }
    792     virtual Completion execute(ExecState *exec);
    793     virtual void processVarDecls(ExecState *exec);
    794     virtual void streamTo(SourceStream &s) const;
    795   private:
    796     RefPtr<VarDeclListNode> list;
     796    VarStatementNode(VarDeclListNode *l) : next(l->next) { l->next = 0; }
     797    virtual Completion execute(ExecState *exec);
     798    virtual void processVarDecls(ExecState *exec);
     799    virtual void streamTo(SourceStream &s) const;
     800  private:
     801    RefPtr<VarDeclListNode> next;
    797802  };
    798803
     
    863868      expr1(e1), expr2(e2), expr3(e3), statement(s) {}
    864869    ForNode(VarDeclListNode *e1, Node *e2, Node *e3, StatementNode *s) :
    865       expr1(e1->list), expr2(e2), expr3(e3), statement(s) { e1->list = 0; }
     870      expr1(e1->next), expr2(e2), expr3(e3), statement(s) { e1->next = 0; }
    866871    virtual Completion execute(ExecState *exec);
    867872    virtual void processVarDecls(ExecState *exec);
     
    932937  class CaseClauseNode : public Node {
    933938  public:
    934     CaseClauseNode(Node *e) : expr(e), list(0) { }
     939    CaseClauseNode(Node *e) : expr(e), next(0) { }
    935940    CaseClauseNode(Node *e, StatListNode *l)
    936       : expr(e), list(l->list) { l->list = 0; }
     941      : expr(e), next(l->next) { l->next = 0; }
    937942    JSValue *evaluate(ExecState *exec);
    938943    Completion evalStatements(ExecState *exec);
     
    941946  private:
    942947    RefPtr<Node> expr;
    943     RefPtr<StatListNode> list;
     948    RefPtr<StatListNode> next;
    944949  };
    945950
     
    947952  public:
    948953    // list pointer is tail of a circular list, cracked in the CaseBlockNode ctor
    949     ClauseListNode(CaseClauseNode *c) : cl(c), nx(this) { }
     954    ClauseListNode(CaseClauseNode *c) : clause(c), next(this) { }
    950955    ClauseListNode(ClauseListNode *n, CaseClauseNode *c)
    951       : cl(c), nx(n->nx) { n->nx = this; }
    952     JSValue *evaluate(ExecState *exec);
    953     CaseClauseNode *clause() const { return cl.get(); }
    954     ClauseListNode *next() const { return nx.get(); }
    955     virtual void processVarDecls(ExecState *exec);
    956     virtual void streamTo(SourceStream &s) const;
     956      : clause(c), next(n->next) { n->next = this; }
     957    JSValue *evaluate(ExecState *exec);
     958    CaseClauseNode *getClause() const { return clause.get(); }
     959    ClauseListNode *getNext() const { return next.get(); }
     960    virtual void processVarDecls(ExecState *exec);
     961    virtual void streamTo(SourceStream &s) const;
     962    PassRefPtr<ClauseListNode> releaseNext() { return next.release(); }
    957963  private:
    958964    friend class CaseBlockNode;
    959     RefPtr<CaseClauseNode> cl;
    960     RefPtr<ClauseListNode> nx;
     965    RefPtr<CaseClauseNode> clause;
     966    ListRefPtr<ClauseListNode> next;
    961967  };
    962968
     
    10231029    // list pointer is tail of a circular list, cracked in the FuncDeclNode/FuncExprNode ctor
    10241030    ParameterNode(const Identifier &i) : id(i), next(this) { }
    1025     ParameterNode(ParameterNode *list, const Identifier &i)
    1026       : id(i), next(list->next) { list->next = this; }
     1031    ParameterNode(ParameterNode *next, const Identifier &i)
     1032      : id(i), next(next->next) { next->next = this; }
    10271033    JSValue *evaluate(ExecState *exec);
    10281034    Identifier ident() { return id; }
    10291035    ParameterNode *nextParam() { return next.get(); }
    10301036    virtual void streamTo(SourceStream &s) const;
     1037    PassRefPtr<ParameterNode> releaseNext() { return next.release(); }
    10311038  private:
    10321039    friend class FuncDeclNode;
    10331040    friend class FuncExprNode;
    10341041    Identifier id;
    1035     RefPtr<ParameterNode> next;
     1042    ListRefPtr<ParameterNode> next;
    10361043  };
    10371044
     
    10751082  class SourceElementsNode : public StatementNode {
    10761083  public:
     1084      static int count;
    10771085    // list pointer is tail of a circular list, cracked in the BlockNode (or subclass) ctor
    10781086    SourceElementsNode(StatementNode *s1);
    10791087    SourceElementsNode(SourceElementsNode *s1, StatementNode *s2);
    1080 
     1088   
    10811089    Completion execute(ExecState *exec);
    10821090    void processFuncDecl(ExecState *exec);
    10831091    virtual void processVarDecls(ExecState *exec);
    10841092    virtual void streamTo(SourceStream &s) const;
     1093    PassRefPtr<SourceElementsNode> releaseNext() { return next.release(); }
    10851094  private:
    10861095    friend class BlockNode;
    1087     RefPtr<StatementNode> element; // 'this' element
    1088     RefPtr<SourceElementsNode> elements; // pointer to next
     1096    RefPtr<StatementNode> node;
     1097    ListRefPtr<SourceElementsNode> next;
    10891098  };
    10901099
  • trunk/JavaScriptCore/kjs/nodes2string.cpp

    r11566 r11802  
    133133void ElementNode::streamTo(SourceStream &s) const
    134134{
    135   for (const ElementNode *n = this; n; n = n->list.get()) {
     135  for (const ElementNode *n = this; n; n = n->next.get()) {
    136136    for (int i = 0; i < n->elision; i++)
    137137      s << ",";
     
    160160  s << node;
    161161 
    162   for (const PropertyListNode *n = list.get(); n; n = n->list.get())
     162  for (const PropertyListNode *n = next.get(); n; n = n->next.get())
    163163    s << ", " << n->node;
    164164}
     
    205205{
    206206  s << expr;
    207   for (ArgumentListNode *n = list.get(); n; n = n->list.get())
     207  for (ArgumentListNode *n = next.get(); n; n = n->next.get())
    208208    s << ", " << n->expr;
    209209}
     
    526526void StatListNode::streamTo(SourceStream &s) const
    527527{
    528   for (const StatListNode *n = this; n; n = n->list.get())
     528  for (const StatListNode *n = this; n; n = n->next.get())
    529529    s << n->statement;
    530530}
     
    543543{
    544544  s << var;
    545   for (VarDeclListNode *n = list.get(); n; n = n->list.get())
     545  for (VarDeclListNode *n = next.get(); n; n = n->next.get())
    546546    s << ", " << n->var;
    547547}
     
    549549void VarStatementNode::streamTo(SourceStream &s) const
    550550{
    551   s << SourceStream::Endl << "var " << list << ";";
     551  s << SourceStream::Endl << "var " << next << ";";
    552552}
    553553
     
    651651    s << "default";
    652652  s << ":" << SourceStream::Indent;
    653   if (list)
    654     s << list;
     653  if (next)
     654    s << next;
    655655  s << SourceStream::Unindent;
    656656}
     
    658658void ClauseListNode::streamTo(SourceStream &s) const
    659659{
    660   for (const ClauseListNode *n = this; n; n = n->next())
    661     s << n->clause();
     660  for (const ClauseListNode *n = this; n; n = n->getNext())
     661    s << n->getClause();
    662662}
    663663
    664664void CaseBlockNode::streamTo(SourceStream &s) const
    665665{
    666   for (const ClauseListNode *n = list1.get(); n; n = n->next())
    667     s << n->clause();
     666  for (const ClauseListNode *n = list1.get(); n; n = n->getNext())
     667    s << n->getClause();
    668668  if (def)
    669669    s << def;
    670   for (const ClauseListNode *n = list2.get(); n; n = n->next())
    671     s << n->clause();
     670  for (const ClauseListNode *n = list2.get(); n; n = n->getNext())
     671    s << n->getClause();
    672672}
    673673
     
    718718void SourceElementsNode::streamTo(SourceStream &s) const
    719719{
    720   for (const SourceElementsNode *n = this; n; n = n->elements.get())
    721     s << n->element;
    722 }
     720  for (const SourceElementsNode *n = this; n; n = n->next.get())
     721    s << n->node;
     722}
Note: See TracChangeset for help on using the changeset viewer.