Wiki Roadmap Timeline Tickets New Ticket Source Search Help / Guide About Trac Login

Changeset 1584:f4c56ed32238

Show
Ignore:
Timestamp:
10/20/09 23:46:56 (3 years ago)
Author:
tomas@localhost.localdomain
branch:
default
Message:

Fixed issue in exception runtime with recent LLVM revisions, with this in place EH seems to work properly on x86-64. These fixes need to be merged into tango trunk still!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ir/irlandingpad.cpp

    r1571 r1584  
    134134    // if there's a finally, the eh table has to have a 0 action 
    135135    if(hasFinally) 
    136         selectorargs.push_back(LLConstantInt::get(LLType::getInt32Ty(gIR->context()), 0)); 
     136        selectorargs.push_back(DtoConstSize_t(0));//LLConstantInt::get(LLType::getInt32Ty(gIR->context()), 0)); 
    137137 
    138138    // personality fn 
  • runtime/internal/eh.d

    r1289 r1584  
    99 
    1010// debug = EH_personality; 
     11// debug = EH_personality_verbose; 
    1112 
    1213// current EH implementation works on x86 
     
    3738extern(C) 
    3839{ 
    39     enum _Unwind_Reason_Code 
     40    enum _Unwind_Reason_Code : int 
    4041    { 
    4142        NO_REASON = 0, 
     
    5051    } 
    5152 
    52     enum _Unwind_Action 
     53    enum _Unwind_Action : int 
    5354    { 
    5455        SEARCH_PHASE = 1, 
     
    6465    struct _Unwind_Exception 
    6566    { 
    66         char[8] exception_class; 
     67        ulong exception_class; 
    6768        _Unwind_Exception_Cleanup_Fn exception_cleanup; 
    6869        ptrdiff_t private_1; 
     
    208209extern(C) _Unwind_Reason_Code _d_eh_personality(int ver, _Unwind_Action actions, ulong exception_class, _Unwind_Exception* exception_info, _Unwind_Context_Ptr context) 
    209210{ 
     211  debug(EH_personality_verbose) printf("entering personality function. context: %p\n", context); 
    210212  // check ver: the C++ Itanium ABI only allows ver == 1 
    211213  if(ver != 1) 
     
    225227  ClassInfo* classinfo_table; 
    226228  _d_getLanguageSpecificTables(context, callsite_table, action_table, classinfo_table); 
    227  
     229  if (callsite_table is null) 
     230    return _Unwind_Reason_Code.CONTINUE_UNWIND; 
    228231 
    229232  /* 
     
    378381{ 
    379382  ubyte* data = cast(ubyte*)_Unwind_GetLanguageSpecificData(context); 
     383  if (data is null) 
     384  { 
     385    //printf("language specific data was null\n"); 
     386    callsite = null; 
     387    action = null; 
     388    ci = null; 
     389    return; 
     390  } 
    380391 
    381392  //TODO: Do proper DWARF reading here 
     
    406417    { 
    407418        _d_exception* exc_struct = new _d_exception; 
    408         exc_struct.unwind_info.exception_class[] = _d_exception_class
     419        exc_struct.unwind_info.exception_class = *cast(ulong*)_d_exception_class.ptr
    409420        exc_struct.exception_object = e; 
    410421        _Unwind_Reason_Code ret = _Unwind_RaiseException(&exc_struct.unwind_info); 
Copyright © 2008, LDC Development Team.