Skip to content

Commit

Permalink
YJIT: Assert code pages are not partially in-bounds
Browse files Browse the repository at this point in the history
Helps understand page switching
  • Loading branch information
XrXr committed Dec 5, 2023
1 parent 695e5c1 commit a063969
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions yjit/src/asm/mod.rs
Expand Up @@ -136,6 +136,10 @@ impl CodeBlock {
};
cb.page_end_reserve = cb.jmp_ptr_bytes();
cb.write_pos = cb.page_start();

#[cfg(not(test))]
assert_eq!(0, mem_size % page_size, "partially in-bounds code pages should be impossible");

cb
}

Expand Down

0 comments on commit a063969

Please sign in to comment.