Ticket #11972: tinsel_memcpy_strict_alignment_wip.diff

File tinsel_memcpy_strict_alignment_wip.diff, 2.6 KB (added by dwatteau, 3 years ago)

quick and incomplete diff removing the first SIGBUSes

  • engines/tinsel/actors.cpp

    diff --git a/engines/tinsel/actors.cpp b/engines/tinsel/actors.cpp
    index a8e06bf141..e1198fc43d 100644
    a b static void ActorRestoredProcess(CORO_PARAM, const void *param) {  
    15311531        CORO_END_CONTEXT(_ctx);
    15321532
    15331533        // get the stuff copied to process when it was created
    1534         const RATP_INIT *r = (const RATP_INIT *)param;
     1534        RATP_INIT cR;
     1535        memcpy(&cR, param, sizeof cR);
     1536        const RATP_INIT *r = (const RATP_INIT *)&cR;
    15351537        bool isSavegame = r->pic->resumeState == RES_SAVEGAME;
    15361538
    15371539        CORO_BEGIN_CODE(_ctx);
  • engines/tinsel/dialogs.cpp

    diff --git a/engines/tinsel/dialogs.cpp b/engines/tinsel/dialogs.cpp
    index 25645da8d9..a2a91ed681 100644
    a b static void ObjectProcess(CORO_PARAM, const void *param) {  
    55855585        CORO_END_CONTEXT(_ctx);
    55865586
    55875587        // get the stuff copied to process when it was created
    5588         const OP_INIT *to = (const OP_INIT *)param;
     5588        OP_INIT cTo;
     5589        memcpy(&cTo, param, sizeof cTo);
     5590        const OP_INIT *to = (const OP_INIT *)&cTo;
    55895591
    55905592        CORO_BEGIN_CODE(_ctx);
    55915593
  • engines/tinsel/faders.cpp

    diff --git a/engines/tinsel/faders.cpp b/engines/tinsel/faders.cpp
    index db6b1bb302..3fb5438416 100644
    a b static void FadeProcess(CORO_PARAM, const void *param) {  
    9797        CORO_END_CONTEXT(_ctx);
    9898
    9999        // get the fade data structure - copied to process when it was created
    100         const FADE *pFade = (const FADE *)param;
     100        FADE cFade;
     101        memcpy(&cFade, param, sizeof cFade);
     102        const FADE *pFade = (const FADE *)&cFade;
    101103
    102104        CORO_BEGIN_CODE(_ctx);
    103105
  • engines/tinsel/rince.cpp

    diff --git a/engines/tinsel/rince.cpp b/engines/tinsel/rince.cpp
    index 8420207ce7..327476fba8 100644
    a b void T1MoverProcess(CORO_PARAM, const void *param) {  
    756756        CORO_BEGIN_CONTEXT;
    757757        CORO_END_CONTEXT(_ctx);
    758758
    759         const PMOVER pActor = *(const PMOVER *)param;
     759        PMOVER cActor;
     760        memcpy(&cActor, param, sizeof cActor);
     761        const PMOVER pActor = *(const PMOVER *)&cActor;
    760762
    761763        CORO_BEGIN_CODE(_ctx);
    762764
  • engines/tinsel/tinsel.cpp

    diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp
    index b1207580d4..ee06ab6cf9 100644
    a b static void RestoredProcess(CORO_PARAM, const void *param) {  
    627627        CORO_BEGIN_CODE(_ctx);
    628628
    629629        // get the stuff copied to process when it was created
    630         _ctx->pic = *((INT_CONTEXT * const *)param);
     630        INT_CONTEXT cPic;
     631        memcpy(&cPic, param, sizeof cPic);
     632        _ctx->pic = *((INT_CONTEXT * const *)&cPic);
    631633
    632634        _ctx->pic = RestoreInterpretContext(_ctx->pic);
    633635        _ctx->bConverse = TinselV2 && (_ctx->pic->event == CONVERSE);