Merge pull request #260 from zorp-corp/ea/dirty-mugging

dirty pma before setting noun metadata
This commit is contained in:
Edward Amsden 2024-08-27 15:43:47 -05:00 committed by GitHub
commit 3860ff021d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,5 @@
use crate::mem::{word_size_of, NockStack};
use crate::persist::{pma_contains,pma_dirty};
use sword_macros::tas;
use bitvec::prelude::{BitSlice, Lsb0};
use either::{Either, Left, Right};
@ -984,6 +985,10 @@ impl Allocated {
}
pub unsafe fn set_metadata(self, metadata: u64) {
let ptr = self.const_to_raw_pointer_mut();
if pma_contains(ptr, 1) {
pma_dirty(ptr, 1);
}
*(self.const_to_raw_pointer_mut()) = metadata;
}