Version 2.3: Difference between revisions

Jump to navigation Jump to search
m
→‎Uninitialized memory: Make transition to C++ port clearer
(→‎Undefined Behavior Fixes: Document another poor ActionScript coding standard (putting all classes onto the stack causing uninitialized memory and reads from uninitialized memory))
m (→‎Uninitialized memory: Make transition to C++ port clearer)
Line 284: Line 284:
=== Uninitialized memory ===
=== Uninitialized memory ===


The game was originally ported from the original ActionScript in the Flash 1.x versions. Ported, ''not'' rewritten. Thus previous versions shared many (poor) ActionScript coding standards. One of these was putting all global variables into classes that were passed around between every function. These classes were allocated on the stack instead of static storage, so they never got the benefit of static storage being automatically initialized, which resulted in many uninitialized variables and many reads from uninitialized memory.
The game was originally ported from the original ActionScript in the Flash 1.x versions. Ported, ''not'' rewritten. Thus previous versions shared many (poor) ActionScript coding standards. One of these was putting all global variables into classes that were passed around between every function. In the C++ port, these classes were allocated on the stack instead of static storage, so they never got the benefit of static storage being automatically initialized, which resulted in many uninitialized variables and many reads from uninitialized memory.


* Playing music for the first time (i.e. pressing ACTION on title screen) reads from uninitialized memory.
* Playing music for the first time (i.e. pressing ACTION on title screen) reads from uninitialized memory.

Navigation menu