diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2023-12-06 12:19:43 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-06 15:19:43 -0500 |
commit | a439fc2f175f5c272886a7be57c6444015450401 (patch) | |
tree | 2894d2b29dc6a0a5072efe4f88461f4eceb35925 /bootstraptest | |
parent | 9336bbb0b268cb655e6c07ad2a83b9a28cb98911 (diff) | |
download | ruby-a439fc2f175f5c272886a7be57c6444015450401.tar.gz |
YJIT: Avoid register allocation conflict with a higher stack_idx (#9143)
YJIT: Avoid register allocation conflict
with a higher stack_idx
Diffstat (limited to 'bootstraptest')
-rw-r--r-- | bootstraptest/test_yjit.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb index 1a4db302d0..ba288a7936 100644 --- a/bootstraptest/test_yjit.rb +++ b/bootstraptest/test_yjit.rb @@ -4273,3 +4273,21 @@ assert_normal_exit %q{ Foo.class_eval "def initialize() #{ivars} end" Foo.new } + +assert_equal '0', %q{ + def spill + 1.to_i # not inlined + end + + def inline(_stack1, _stack2, _stack3, _stack4, _stack5) + 0 # inlined + end + + def entry + # RegTemps is 00111110 prior to the #inline call. + # Its return value goes to stack_idx=0, which conflicts with stack_idx=5. + inline(spill, 2, 3, 4, 5) + end + + entry +} |