Changeset 2198


Ignore:
Timestamp:
Jan 3, 2013, 10:02:04 PM (7 years ago)
Author:
sam
Message:

base: fix more memory corruptions in the Array class.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lol/base/array.h

    r2184 r2198  
    310310        else
    311311        {
    312             this->m_data[this->m_count].m1 = m1;
    313             this->m_data[this->m_count].m2 = m2;
    314             this->m_data[this->m_count].m3 = m3;
    315             this->m_data[this->m_count].m4 = m4;
    316             this->m_data[this->m_count].m5 = m5;
    317             this->m_data[this->m_count].m6 = m6;
    318             this->m_data[this->m_count].m7 = m7;
    319             this->m_data[this->m_count].m8 = m8;
     312            new (&this->m_data[this->m_count].m1) T1(m1);
     313            new (&this->m_data[this->m_count].m2) T2(m2);
     314            new (&this->m_data[this->m_count].m3) T3(m3);
     315            new (&this->m_data[this->m_count].m4) T4(m4);
     316            new (&this->m_data[this->m_count].m5) T5(m5);
     317            new (&this->m_data[this->m_count].m6) T6(m6);
     318            new (&this->m_data[this->m_count].m7) T7(m7);
     319            new (&this->m_data[this->m_count].m8) T8(m8);
    320320        }
    321321        ++this->m_count;
     
    348348        else
    349349        {
    350             this->m_data[this->m_count].m1 = m1;
    351             this->m_data[this->m_count].m2 = m2;
    352             this->m_data[this->m_count].m3 = m3;
    353             this->m_data[this->m_count].m4 = m4;
    354             this->m_data[this->m_count].m5 = m5;
    355             this->m_data[this->m_count].m6 = m6;
    356             this->m_data[this->m_count].m7 = m7;
     350            new (&this->m_data[this->m_count].m1) T1(m1);
     351            new (&this->m_data[this->m_count].m2) T2(m2);
     352            new (&this->m_data[this->m_count].m3) T3(m3);
     353            new (&this->m_data[this->m_count].m4) T4(m4);
     354            new (&this->m_data[this->m_count].m5) T5(m5);
     355            new (&this->m_data[this->m_count].m6) T6(m6);
     356            new (&this->m_data[this->m_count].m7) T7(m7);
    357357        }
    358358        ++this->m_count;
     
    384384        else
    385385        {
    386             this->m_data[this->m_count].m1 = m1;
    387             this->m_data[this->m_count].m2 = m2;
    388             this->m_data[this->m_count].m3 = m3;
    389             this->m_data[this->m_count].m4 = m4;
    390             this->m_data[this->m_count].m5 = m5;
    391             this->m_data[this->m_count].m6 = m6;
     386            new (&this->m_data[this->m_count].m1) T1(m1);
     387            new (&this->m_data[this->m_count].m2) T2(m2);
     388            new (&this->m_data[this->m_count].m3) T3(m3);
     389            new (&this->m_data[this->m_count].m4) T4(m4);
     390            new (&this->m_data[this->m_count].m5) T5(m5);
     391            new (&this->m_data[this->m_count].m6) T6(m6);
    392392        }
    393393        ++this->m_count;
     
    417417        else
    418418        {
    419             this->m_data[this->m_count].m1 = m1;
    420             this->m_data[this->m_count].m2 = m2;
    421             this->m_data[this->m_count].m3 = m3;
    422             this->m_data[this->m_count].m4 = m4;
    423             this->m_data[this->m_count].m5 = m5;
     419            new (&this->m_data[this->m_count].m1) T1(m1);
     420            new (&this->m_data[this->m_count].m2) T2(m2);
     421            new (&this->m_data[this->m_count].m3) T3(m3);
     422            new (&this->m_data[this->m_count].m4) T4(m4);
     423            new (&this->m_data[this->m_count].m5) T5(m5);
    424424        }
    425425        ++this->m_count;
     
    446446        else
    447447        {
    448             this->m_data[this->m_count].m1 = m1;
    449             this->m_data[this->m_count].m2 = m2;
    450             this->m_data[this->m_count].m3 = m3;
    451             this->m_data[this->m_count].m4 = m4;
     448            new (&this->m_data[this->m_count].m1) T1(m1);
     449            new (&this->m_data[this->m_count].m2) T2(m2);
     450            new (&this->m_data[this->m_count].m3) T3(m3);
     451            new (&this->m_data[this->m_count].m4) T4(m4);
    452452        }
    453453        ++this->m_count;
     
    473473        else
    474474        {
    475             this->m_data[this->m_count].m1 = m1;
    476             this->m_data[this->m_count].m2 = m2;
    477             this->m_data[this->m_count].m3 = m3;
     475            new (&this->m_data[this->m_count].m1) T1(m1);
     476            new (&this->m_data[this->m_count].m2) T2(m2);
     477            new (&this->m_data[this->m_count].m3) T3(m3);
    478478        }
    479479        ++this->m_count;
     
    498498        else
    499499        {
    500             this->m_data[this->m_count].m1 = m1;
    501             this->m_data[this->m_count].m2 = m2;
     500            new (&this->m_data[this->m_count].m1) T1(m1);
     501            new (&this->m_data[this->m_count].m2) T2(m2);
    502502        }
    503503        ++this->m_count;
Note: See TracChangeset for help on using the changeset viewer.