fix stack alignement

- adjust align() in RawBlockTraits impl for Stack
- ensure ptr is always aligned in RawBlock::allock
This commit is contained in:
Bennet Bleßmann
2024-07-06 16:21:20 +02:00
parent 8e53d12776
commit fee7ba58b0
2 changed files with 6 additions and 4 deletions

View File

@@ -15,7 +15,9 @@ impl RawBlockTraits for Stack {
#[inline]
fn align() -> usize {
mem::align_of::<HeapCellValue>()
mem::align_of::<OrFrame>()
.max(mem::align_of::<AndFrame>())
.max(mem::align_of::<HeapCellValue>())
}
}
@@ -281,7 +283,6 @@ mod tests {
use crate::machine::mock_wam::*;
#[test]
#[cfg_attr(miri, ignore = "blocked on stack.rs UB")]
fn stack_tests() {
let mut wam = MockWAM::new();