Skip to content
  • NARUSE, Yui's avatar
    b73a0735
    merge revision(s) 0eb634ae: [Backport #19464] · b73a0735
    NARUSE, Yui authored
    	YJIT: Detect and reject `send(:alias_for_send, :foo)`
    
    	Previously, YJIT failed to put the stack into the correct shape when
    	`BasicObject#send` calls an alias method for the send method itself.
    	This can manifest as strange `NoMethodError`s in the final non-send
    	receiver, as [seen][1] with the kt-paperclip gem. I also found a case
    	where it makes YJIT fail the stack size assertion while compiling
    	`leave`.
    
    	YJIT's `BasicObject#__send__` implementation already rejects sends to
    	`send`, but didn't detect sends to aliases of `send`. Adjust the
    	detection and reject these cases.
    
    	Fixes [Bug #19464]
    
    	[1]: https://github.com/Shopify/yjit/issues/306
    	---
    	 test/ruby/test_yjit.rb | 20 ++++++++++++++++++++
    	 yjit/src/codegen.rs    | 25 ++++++++++---------------
    	 2 files changed, 30 insertions(+), 15 deletions(-)
    b73a0735
    merge revision(s) 0eb634ae: [Backport #19464]
    NARUSE, Yui authored
    	YJIT: Detect and reject `send(:alias_for_send, :foo)`
    
    	Previously, YJIT failed to put the stack into the correct shape when
    	`BasicObject#send` calls an alias method for the send method itself.
    	This can manifest as strange `NoMethodError`s in the final non-send
    	receiver, as [seen][1] with the kt-paperclip gem. I also found a case
    	where it makes YJIT fail the stack size assertion while compiling
    	`leave`.
    
    	YJIT's `BasicObject#__send__` implementation already rejects sends to
    	`send`, but didn't detect sends to aliases of `send`. Adjust the
    	detection and reject these cases.
    
    	Fixes [Bug #19464]
    
    	[1]: https://github.com/Shopify/yjit/issues/306
    	---
    	 test/ruby/test_yjit.rb | 20 ++++++++++++++++++++
    	 yjit/src/codegen.rs    | 25 ++++++++++---------------
    	 2 files changed, 30 insertions(+), 15 deletions(-)
Loading