Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MIPS: Make sure callee-saved registers end up on word boundaries
In addition to handling parameters and local variables, mono_arch_allocate_vars reserves space for callee-saved registers. Even though the current implementation takes care of properly aligning the variables according to their datatype, it doesn't force alignment to a word boundary before processing the callee-saved area. This can result in misaligned accesses if the last locals are booleans or small integers. Worse still: the garbage collector does then not see these non-word- aligned references, and can end up reclaiming the pointed-to objects if there are no other references to them--causing strange crashes and type morphing effects under memory pressure. Fix that by forcibly aligning the callee-saved area. Commit contributed under the MIT/X11 license.
- Loading branch information