[Scummvm-tracker] [ScummVM :: Bugs] #14507: TONY: Engine crashes on strict-alignment platforms

ScummVM :: Bugs trac at scummvm.org
Sat Jul 8 07:49:37 UTC 2023


#14507: TONY: Engine crashes on strict-alignment platforms
-----------------------------+---------------------------
Reporter:  dwatteau          |       Owner:  (none)
    Type:  defect            |      Status:  new
Priority:  normal            |   Component:  Engine: Tony
 Version:                    |  Resolution:
Keywords:  strict alignment  |        Game:  Tony Tough
-----------------------------+---------------------------
Comment (by eriktorbjorn):

 It looks to me like it allocates memory blocks (in expr.cpp) for one or
 more `Expression`s, plus one byte at the beginning to store the size of
 the block, measured in number of `Expression`s.

 It's probably that that puts each `Expression` on an unaligned address.

 I'm not really familiar with this engine, but it seems to me that there
 could be two ways forward:

 - Instead of using a single byte, use a larger type so that the
 `Expression`s end up on aligned addresses. Is there any good way to figure
 out what the alignment is?
 - Instead of storing the size in the memory block, wouldn't it be possible
 to ask the memory manager for the size with `globalSize() /
 sizeof(Expression)`?
-- 
Ticket URL: <https://bugs.scummvm.org/ticket/14507#comment:1>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM


More information about the Scummvm-tracker mailing list