[Scummvm-devel] M4/MADS bug (Was: Wii & Gamecube (resp. PowerPC) vs. unaligned memory access)
Max Horn
max at quendi.de
Tue May 10 14:48:05 CEST 2011
Am 09.05.2011 um 16:41 schrieb Max Horn:
> As a small update, the (strict) aliasing warnings might be useful, even if we ultimately disable strict aliasing. E.g. it just pointed me to this code in m4/mads_logic.cpp:
>
> void MadsSceneLogic::initialiseDataMap() {
> // The unique order of these items must be maintained
> MAP_DATA((uint16 *)&_madsVm->scene()->_abortTimersMode2);
>
> Note that _abortTimersMode2 is an enum, which usually is an int, which is 32bit, so I would expect that code to fail to work correctly on big endian systems.
TO clarify, an enum is not even always 32bit; by the standard it could be a char, short or int, signed or unsigned, and probably more. So even on LE systems that code is not correct.
I made a patch for it, but since I can't test the M4 engine, I'd be happy if somebody from the M4 subteam could review it: <https://github.com/scummvm/scummvm/pull/36>
Bye,
Max
More information about the Scummvm-devel
mailing list