aboutsummaryrefslogtreecommitdiffstats
path: root/yjit
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2023-12-05 11:40:17 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2023-12-05 13:20:06 -0500
commita063969ec18c8f213d9c70471a29d0d31ec5850a (patch)
treed1c6a9a5ec4b1b63c52ad7e594dac6812d85e133 /yjit
parent695e5c179ed06761e47c700c6b31a26f48eee699 (diff)
downloadruby-a063969ec18c8f213d9c70471a29d0d31ec5850a.tar.gz
YJIT: Assert code pages are not partially in-bounds
Helps understand page switching
Diffstat (limited to 'yjit')
-rw-r--r--yjit/src/asm/mod.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/yjit/src/asm/mod.rs b/yjit/src/asm/mod.rs
index 2bd776ec81..524d6341f5 100644
--- a/yjit/src/asm/mod.rs
+++ b/yjit/src/asm/mod.rs
@@ -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
}