mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	Always correct sp on leave cancel
Even if local stack optimization is not used and values are written to VM stack, the stack pointer itself may not be moved properly. So this should be always moved on JIT cancellation. By the way it's hard to write a test for this because if we try to generate an interrupt, it will be a method call and it consumes the interrupt by itself on popping a frame.
This commit is contained in:
		
							parent
							
								
									0244f91e89
								
							
						
					
					
						commit
						a5073c053f
					
				
					 1 changed files with 1 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -74,9 +74,7 @@ switch (insn) {
 | 
			
		|||
      if (status->inlined_iseqs != NULL) { // the current ISeq is NOT being inlined
 | 
			
		||||
%         # Cancel on interrupts to make leave insn leaf
 | 
			
		||||
          fprintf(f, "    if (UNLIKELY(RUBY_VM_INTERRUPTED_ANY(ec))) {\n");
 | 
			
		||||
          if (status->local_stack_p) {
 | 
			
		||||
              fprintf(f, "        reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
 | 
			
		||||
          }
 | 
			
		||||
          fprintf(f, "        reg_cfp->sp = vm_base_ptr(reg_cfp) + %d;\n", b->stack_size);
 | 
			
		||||
          fprintf(f, "        reg_cfp->pc = original_body_iseq + %d;\n", pos);
 | 
			
		||||
          fprintf(f, "        goto cancel;\n");
 | 
			
		||||
          fprintf(f, "    }\n");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue