File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change
1
+ # regression test for return type of Integer#/
2
+ # It can return a T_BIGNUM when inputs are T_FIXNUM.
3
+ assert_equal 0x3fffffffffffffff . to_s , %q{
4
+ def call(fixnum_min)
5
+ (fixnum_min / -1) - 1
6
+ end
7
+
8
+ call(-(2**62))
9
+ }
10
+
1
11
# regression test for return type of String#<<
2
12
assert_equal 'Sub' , %q{
3
13
def call(sub) = (sub << sub).itself
Original file line number Diff line number Diff line change @@ -4531,6 +4531,9 @@ fn jit_rb_int_div(
4531
4531
}
4532
4532
guard_two_fixnums ( jit, asm, ocb) ;
4533
4533
4534
+ // rb_fix_div_fix may GC-allocate for Bignum
4535
+ jit_prepare_routine_call ( jit, asm) ;
4536
+
4534
4537
asm. comment ( "Integer#/" ) ;
4535
4538
let obj = asm. stack_pop ( 1 ) ;
4536
4539
let recv = asm. stack_pop ( 1 ) ;
@@ -4541,7 +4544,7 @@ fn jit_rb_int_div(
4541
4544
4542
4545
let ret = asm. ccall ( rb_fix_div_fix as * const u8 , vec ! [ recv, obj] ) ;
4543
4546
4544
- let ret_opnd = asm. stack_push ( Type :: Fixnum ) ;
4547
+ let ret_opnd = asm. stack_push ( Type :: Unknown ) ;
4545
4548
asm. mov ( ret_opnd, ret) ;
4546
4549
true
4547
4550
}
You can’t perform that action at this time.
0 commit comments