Changeset 1139

Show
Ignore:
Timestamp:
04/29/08 21:07:38 (4 months ago)
Author:
asterite
Message:

Some more small bugs... good night!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/descent.core/src/descent/internal/compiler/parser/ClassDeclaration.java

    r1117 r1139  
    870870        buf.writeByte('{'); 
    871871        buf.writenl(); 
    872         for (int i = 0; i < members.size(); i++) { 
    873             Dsymbol s = members.get(i); 
    874  
    875             buf.writestring("    "); 
    876             s.toCBuffer(buf, hgs, context); 
     872        if (members != null) { 
     873            for (int i = 0; i < members.size(); i++) { 
     874                Dsymbol s = members.get(i); 
     875     
     876                buf.writestring("    "); 
     877                s.toCBuffer(buf, hgs, context); 
     878            } 
    877879        } 
    878880        buf.writestring("}"); 
  • trunk/descent.core/src/descent/internal/compiler/parser/InterfaceDeclaration.java

    r1136 r1139  
    7777        cd.consumeRest(); 
    7878         
    79         for (j = 0; j < cd.interfaces.size(); j++) { 
    80             BaseClass b = cd.interfaces.get(j); 
    81  
    82             if (SemanticMixin.equals(this, b.base)) { 
    83                 if (poffset != null) { 
    84                     poffset[0] = b.offset; 
    85                     if (j != 0 && cd.isInterfaceDeclaration() != null) { 
     79        if (cd != null && cd.interfaces != null) { 
     80            for (j = 0; j < cd.interfaces.size(); j++) { 
     81                BaseClass b = cd.interfaces.get(j); 
     82     
     83                if (SemanticMixin.equals(this, b.base)) { 
     84                    if (poffset != null) { 
     85                        poffset[0] = b.offset; 
     86                        if (j != 0 && cd.isInterfaceDeclaration() != null) { 
     87                            poffset[0] = OFFSET_RUNTIME; 
     88                        } 
     89                    } 
     90                    return true; 
     91                } 
     92                if (isBaseOf(b, poffset)) { 
     93                    if (j != 0 && poffset != null 
     94                            && cd.isInterfaceDeclaration() != null) { 
    8695                        poffset[0] = OFFSET_RUNTIME; 
    8796                    } 
    88                 } 
    89                 return true; 
    90             } 
    91             if (isBaseOf(b, poffset)) { 
    92                 if (j != 0 && poffset != null 
    93                         && cd.isInterfaceDeclaration() != null) { 
    94                     poffset[0] = OFFSET_RUNTIME; 
    95                 } 
    96                 return true; 
     97                    return true; 
     98                } 
    9799            } 
    98100        }