internal override unsafe void GetEHInfo(int excNumber, void *exc)
 {
     Resolver.CORINFO_EH_CLAUSE *corinfo_eh_clausePtr = (Resolver.CORINFO_EH_CLAUSE *)exc;
     for (int i = 0; i < this.m_exceptions.Length; i++)
     {
         int numberOfCatches = this.m_exceptions[i].GetNumberOfCatches();
         if (excNumber < numberOfCatches)
         {
             corinfo_eh_clausePtr->Flags     = this.m_exceptions[i].GetExceptionTypes()[excNumber];
             corinfo_eh_clausePtr->Flags    |= 0x20000000;
             corinfo_eh_clausePtr->TryOffset = this.m_exceptions[i].GetStartAddress();
             if ((corinfo_eh_clausePtr->Flags & 2) != 2)
             {
                 corinfo_eh_clausePtr->TryLength = this.m_exceptions[i].GetEndAddress() - corinfo_eh_clausePtr->TryOffset;
             }
             else
             {
                 corinfo_eh_clausePtr->TryLength = this.m_exceptions[i].GetFinallyEndAddress() - corinfo_eh_clausePtr->TryOffset;
             }
             corinfo_eh_clausePtr->HandlerOffset            = this.m_exceptions[i].GetCatchAddresses()[excNumber];
             corinfo_eh_clausePtr->HandlerLength            = this.m_exceptions[i].GetCatchEndAddresses()[excNumber] - corinfo_eh_clausePtr->HandlerOffset;
             corinfo_eh_clausePtr->ClassTokenOrFilterOffset = this.m_exceptions[i].GetFilterAddresses()[excNumber];
             return;
         }
         excNumber -= numberOfCatches;
     }
 }
Esempio n. 2
0
 internal override unsafe void GetEHInfo(int excNumber, void *exc)
 {
     Resolver.CORINFO_EH_CLAUSE *corinfoEhClausePtr = (Resolver.CORINFO_EH_CLAUSE *)exc;
     for (int index = 0; index < this.m_exceptions.Length; ++index)
     {
         int numberOfCatches = this.m_exceptions[index].GetNumberOfCatches();
         if (excNumber < numberOfCatches)
         {
             corinfoEhClausePtr->Flags                    = this.m_exceptions[index].GetExceptionTypes()[excNumber];
             corinfoEhClausePtr->TryOffset                = this.m_exceptions[index].GetStartAddress();
             corinfoEhClausePtr->TryLength                = (corinfoEhClausePtr->Flags & 2) == 2 ? this.m_exceptions[index].GetFinallyEndAddress() - corinfoEhClausePtr->TryOffset : this.m_exceptions[index].GetEndAddress() - corinfoEhClausePtr->TryOffset;
             corinfoEhClausePtr->HandlerOffset            = this.m_exceptions[index].GetCatchAddresses()[excNumber];
             corinfoEhClausePtr->HandlerLength            = this.m_exceptions[index].GetCatchEndAddresses()[excNumber] - corinfoEhClausePtr->HandlerOffset;
             corinfoEhClausePtr->ClassTokenOrFilterOffset = this.m_exceptions[index].GetFilterAddresses()[excNumber];
             break;
         }
         excNumber -= numberOfCatches;
     }
 }