File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -154,8 +154,9 @@ impl CodeBlock {
154154 }
155155
156156 // Move the other CodeBlock to the same page if it's on the furthest page
157- #[ cfg( not( test) ) ]
158- self . other_cb ( ) . unwrap ( ) . set_page ( next_page_idx. unwrap ( ) , & jmp_ptr) ;
157+ if cfg ! ( not( test) ) {
158+ self . other_cb ( ) . unwrap ( ) . set_page ( next_page_idx. unwrap ( ) , & jmp_ptr) ;
159+ }
159160
160161 return !self . dropped_bytes ;
161162 }
@@ -584,6 +585,8 @@ impl CodeBlock {
584585
585586 /// Code GC. Free code pages that are not on stack and reuse them.
586587 pub fn code_gc ( & mut self , ocb : & mut OutlinedCb ) {
588+ assert ! ( self . inline( ) , "must use on inline code block" ) ;
589+
587590 // The previous code GC failed to free any pages. Give up.
588591 if self . freed_pages . as_ref ( ) == & Some ( vec ! [ ] ) {
589592 return ;
@@ -641,7 +644,7 @@ impl CodeBlock {
641644 // Track which pages are free.
642645 let new_freed_pages = Rc :: new ( Some ( freed_pages) ) ;
643646 let old_freed_pages = mem:: replace ( & mut self . freed_pages , Rc :: clone ( & new_freed_pages) ) ;
644- self . other_cb ( ) . unwrap ( ) . freed_pages = new_freed_pages;
647+ ocb . unwrap ( ) . freed_pages = new_freed_pages;
645648 assert_eq ! ( 1 , Rc :: strong_count( & old_freed_pages) ) ; // will deallocate
646649
647650 CodegenGlobals :: incr_code_gc_count ( ) ;
You can’t perform that action at this time.
0 commit comments