diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2022-11-23 09:02:05 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-23 12:02:05 -0500 |
commit | d88adaad7ea4761bd36c957260667840472fd2dc (patch) | |
tree | bd1bfb293a5ff039ff39645b16c8afdfad502e2d /yjit/src/asm | |
parent | 9c36de3c484f104a59033d75855864853c4325c4 (diff) | |
download | ruby-d88adaad7ea4761bd36c957260667840472fd2dc.tar.gz |
YJIT: Use NonNull pointer for CodePtr (#6792)
Diffstat (limited to 'yjit/src/asm')
-rw-r--r-- | yjit/src/asm/mod.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/yjit/src/asm/mod.rs b/yjit/src/asm/mod.rs index 728444b281..417d664b07 100644 --- a/yjit/src/asm/mod.rs +++ b/yjit/src/asm/mod.rs @@ -636,12 +636,13 @@ impl CodeBlock { impl CodeBlock { /// Stubbed CodeBlock for testing. Can't execute generated code. pub fn new_dummy(mem_size: usize) -> Self { + use std::ptr::NonNull; use crate::virtualmem::*; use crate::virtualmem::tests::TestingAllocator; let alloc = TestingAllocator::new(mem_size); let mem_start: *const u8 = alloc.mem_start(); - let virt_mem = VirtualMem::new(alloc, 1, mem_start as *mut u8, mem_size); + let virt_mem = VirtualMem::new(alloc, 1, NonNull::new(mem_start as *mut u8).unwrap(), mem_size); Self::new(Rc::new(RefCell::new(virt_mem)), 16 * 1024, false) } |