Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changeset 507

Show
Ignore:
Timestamp:
01/14/11 08:00:57 (14 years ago)
Author:
Don Clugston
Message:

No longer need to throw and catch Objects.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/rt/arrayassign.d

    r441 r507  
    100100    int i; 
    101101    try 
    102102    { 
    103103        for (i = 0; i < to.length; i++) 
    104104        { 
    105105            // Copy construction is defined as bit copy followed by postblit. 
    106106            memcpy(to.ptr + i * element_size, from.ptr + i * element_size, element_size); 
    107107            ti.postblit(to.ptr + i * element_size); 
    108108        } 
    109109    } 
    110     catch (Object o) 
     110    catch (Throwable o) 
    111111    { 
    112112        /* Destroy, in reverse order, what we've constructed so far 
    113113         */ 
    114114        while (i--) 
    115115        { 
    116116            ti.destroy(to.ptr + i * element_size); 
    117117        } 
    118118 
    119119        throw o; 
    120120    } 
     
    165165    try 
    166166    { 
    167167        foreach (i; 0 .. count) 
    168168        { 
    169169            // Copy construction is defined as bit copy followed by postblit. 
    170170            memcpy(p, value, element_size); 
    171171            ti.postblit(p); 
    172172            p += element_size; 
    173173        } 
    174174    } 
    175     catch (Object o) 
     175    catch (Throwable o) 
    176176    { 
    177177        // Destroy, in reverse order, what we've constructed so far 
    178178        while (p > pstart) 
    179179        { 
    180180            p -= element_size; 
    181181            ti.destroy(p); 
    182182        } 
    183183 
    184184        throw o; 
    185185    } 
  • trunk/src/rt/dmain2.d

    r502 r507  
    272272        _moduleCtor(); 
    273273        _moduleTlsCtor(); 
    274274        runModuleUnitTests(); 
    275275        return true; 
    276276    } 
    277277    catch (Throwable e) 
    278278    { 
    279279        if (dg) 
    280280            dg(e); 
    281281    } 
    282     catch 
    283     { 
    284  
    285     } 
    286282    _d_criticalTerm(); 
    287283    return false; 
    288284} 
    289285 
    290286void _d_criticalTerm() 
    291287{ 
    292288    version (Posix) 
    293289    { 
    294290        _STD_critical_term(); 
    295291        _STD_monitor_staticdtor(); 
     
    304300        thread_joinAll(); 
    305301        _d_isHalting = true; 
    306302        _moduleDtor(); 
    307303        gc_term(); 
    308304        return true; 
    309305    } 
    310306    catch (Throwable e) 
    311307    { 
    312308        if (dg) 
    313309            dg(e); 
    314     } 
    315     catch 
    316     { 
    317  
    318310    } 
    319311    finally 
    320312    { 
    321313        _d_criticalTerm(); 
    322314    } 
    323315    return false; 
    324316} 
    325317 
    326318/*********************************** 
    327319 * The D main() function supplied by the user's program