File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3822,3 +3822,22 @@ def calling_my_func
38223822assert_equal '0' , %q{
38233823 3[0, 0]
38243824}
3825+
3826+ # unspecified_bits + checkkeyword
3827+ assert_equal '2' , %q{
3828+ def callee = 1
3829+
3830+ # checkkeyword should see unspecified_bits=0 (use bar), not Integer 1 (set bar = foo).
3831+ def foo(foo, bar: foo) = bar
3832+
3833+ def entry(&block)
3834+ # write 1 at stack[3]. Calling #callee spills stack[3].
3835+ 1 + (1 + (1 + (1 + callee)))
3836+ # &block is written to a register instead of stack[3]. When &block is popped and
3837+ # unspecified_bits is pushed, it must be written to stack[3], not to a register.
3838+ foo(1, bar: 2, &block)
3839+ end
3840+
3841+ entry # call branch_stub_hit (spill temps)
3842+ entry # doesn't call branch_stub_hit (not spill temps)
3843+ }
Original file line number Diff line number Diff line change @@ -6172,6 +6172,7 @@ fn gen_send_iseq(
61726172 // pushed onto the stack that represents the parameters that weren't
61736173 // explicitly given a value and have a non-constant default.
61746174 let unspec_opnd = VALUE :: fixnum_from_usize ( unspecified_bits) . as_u64 ( ) ;
6175+ asm. spill_temps ( ctx) ; // avoid using a register for unspecified_bits
61756176 asm. mov ( ctx. stack_opnd ( -1 ) , unspec_opnd. into ( ) ) ;
61766177 }
61776178
You can’t perform that action at this time.
0 commit comments