[Scummvm-tracker] [ScummVM :: Bugs] #14507: TONY: Engine crashes on strict-alignment platforms
ScummVM :: Bugs
trac at scummvm.org
Sat Jul 8 09:09:29 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):
I believe the following functions would have to be changed:
- `duplicateExpession(MpalHandle h)`
- `evaluateAndFreeExpression(byte *expr)`
- `parseExpression(const byte *lpBuf, const
Common::UnalignedPtr<MpalHandle> &h)`
- `compareExpressions(MpalHandle h1, MpalHandle h2)`
- `freeExpression(MpalHandle h)`
If I understand correctly, as long as you have an `MpalHandle` you can ask
the memory manager for the size of the block. Because while `MpalHandle`
is just a void pointer, it should still always point to a `MemoryItem`.
But when there's just a raw byte pointer...? Probably not. The memory
manager only keeps some meta data on each block it allocates, but doesn't
actually keep track of them afterwards.
So the "ask memory manager for size" options is probably out.
So what about increasing the size of the counter at the beginning of the
block? Would it be enough to increase it to the size of `intptr_t`? We can
still have it only ''use'' the first byte.
--
Ticket URL: <https://bugs.scummvm.org/ticket/14507#comment:2>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM
More information about the Scummvm-tracker
mailing list